I have some problem with double request/response in DetailViewer.
My Example
I have ListGrid with field "id". When user clicks on the ListGrid Record
I make DetailViewer.fetchData({id: myListGrid.getSelectedRecord().id})
but the smartclient making request twice. WHY?
In LOG I see two requests and two response after one record click
Maybe I'm doing something wrong?
THANKS for help
My Example
I have ListGrid with field "id". When user clicks on the ListGrid Record
I make DetailViewer.fetchData({id: myListGrid.getSelectedRecord().id})
but the smartclient making request twice. WHY?
Code:
isc.ListGrid.create ({ ID: "CntrViewerGrid", showAllRecords: true, dataSource: CntrViewerGridDS, autoFetchData: false, waitForSave: true, selectionType: "single", modalEditing: true, autoDraw: true, fields: [ { name: "id", type: "integer", title: "Number" }, ... ], recordClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue) { isc.logWarn("RecordClick: "); CntrInfoViewer.setData({}); CntrInfoViewer.fetchData(); } }); isc.DataSource.create ({ ID: "CntrInfoGridDS", dataURL: "CntrInfoGridDS.pl", dataFormat: "json", recordXPath: "/response/data", dataProtocol: "postParams", transformRequest: function (dsRequest) { isc.logWarn("transformRequest: " + isc.echo(dsRequest)); if (dsRequest.operationType == "fetch") { var params = { id: CntrViewerGrid.getSelectedRecord().id }; }; return isc.addProperties({}, dsRequest.data, params); }, transformResponse: function (dsResponse, dsRequest, data) { isc.logWarn("transformResponse: " + isc.echo(dsRequest)); }, fields: { id: { name: "id", primaryKey: true, type: "integer", hidden: true }, ... } }); isc.DetailViewer.create ({ ID: "CntrInfoViewer", dataSource: CntrInfoGridDS, canSelectText: true, autoFetchData: false, fields: [ {name: "linename", title: "Salesdeck"}, ... ] });
Code:
20:53:29.500:MUP6:WARN:Log:RecordClick: 20:53:29.515:MUP6:WARN:Log:Request: {operationType: "fetch", dataSource: "CntrInfoGridDS", data: Obj{ID:602695}, callback: Obj, operation: Obj{ID:CntrInfoGridDS_fetch}, startRow: 0, endRow: 75, sortBy: undef, resultSet: [ResultSet ID:isc_ResultSet_48], clientContext: Obj, willHandleError: true, prompt: "Finding records that match your criteria..."[43], showPrompt: true, originalData: Obj{ID:602695}} 20:53:29.703:RDQ2:WARN:Log:Request: {operationType: "fetch", dataSource: "CntrInfoGridDS", data: Obj{ID:602695}, callback: Obj, operation: Obj{ID:CntrInfoGridDS_fetch}, startRow: 0, endRow: 10000, sortBy: undef, resultSet: [ResultSet ID:isc_ResultSet_48], clientContext: Obj, willHandleError: true, prompt: "Finding records that match your criteria..."[43], showPrompt: true, originalData: Obj{ID:602695}} 20:53:29.796:XRP4:WARN:Log:transformResponse: {operationType: "fetch", dataSource: "CntrInfoGridDS", data: Obj{ID:602695}, callback: Obj, operation: Obj{ID:CntrInfoGridDS_fetch}, startRow: 0, endRow: 75, sortBy: undef, resultSet: [ResultSet ID:isc_ResultSet_48], clientContext: Obj, willHandleError: true, prompt: "Finding records that match your criteria..."[43], showPrompt: true, originalData: Obj{ID:602695}} 20:53:29.906:XRP7:WARN:Log:transformResponse: {operationType: "fetch", dataSource: "CntrInfoGridDS", data: Obj{ID:602695}, callback: Obj, operation: Obj{ID:CntrInfoGridDS_fetch}, startRow: 0, endRow: 10000, sortBy: undef, resultSet: [ResultSet ID:isc_ResultSet_48], clientContext: Obj, willHandleError: true, prompt: "Finding records that match your criteria..."[43], showPrompt: true, originalData: Obj{ID:602695}}
THANKS for help
Comment