Hello Isomorphic,
There is a certain requirement described below with a possible solution
that would need a patch in the isomorphic JS library.
Could you please verify the solution from your perspective and in case it makes sense, may be consider to apply the patch.
Version: SmartClient Version: v9.1p_2014-11-19/Pro Deployment (built 2014-11-19)
Requirement:
- ListGrid data fetch should return a resultSet that only contains the columns of the ListGrid, not the full object specified by the datasource.
(But still support the original behavior as needed)
- Usage of a specific operationBinding with limited "outputs" is considered to be to "customized". A more general approach is requested.
Possible solution:
- Define the "outputs" limitation as part of the ListGrid definition:
This already works for the initial data fetch.
Problem:
Subsequent fetches (filter, sort, ...) operate on the ResultSet and do override the context settings.
The override happens in DataBoundComponents.js
updateDataModel : function (filterCriteria, operation, context)
...
resultSet.setContext(context);
...
The patch would be to merge the context.
In the code below, merge the "outputs" property back in.
May be overriding the context regardless, as in the original source code,
might have already introduced problems in the past.
If merging the context is ok, the ListGrid class could even be extended to request only columns or full data objects by using a flag, so the configuration part in <dataproperties> section would not be needed but is done automatically within the ListGrid class.
Of course Master/Detail features need to be reworked too.
What do you think?
Thank you,
Daniel
There is a certain requirement described below with a possible solution
that would need a patch in the isomorphic JS library.
Could you please verify the solution from your perspective and in case it makes sense, may be consider to apply the patch.
Version: SmartClient Version: v9.1p_2014-11-19/Pro Deployment (built 2014-11-19)
Requirement:
- ListGrid data fetch should return a resultSet that only contains the columns of the ListGrid, not the full object specified by the datasource.
(But still support the original behavior as needed)
- Usage of a specific operationBinding with limited "outputs" is considered to be to "customized". A more general approach is requested.
Possible solution:
- Define the "outputs" limitation as part of the ListGrid definition:
Code:
<ListGrid ...
<dataProperties >
<context>
<outputs>Col1, Col2, Col3</outputs>
</context>
</dataProperties>
</ListGrid>Problem:
Subsequent fetches (filter, sort, ...) operate on the ResultSet and do override the context settings.
The override happens in DataBoundComponents.js
updateDataModel : function (filterCriteria, operation, context)
...
resultSet.setContext(context);
...
The patch would be to merge the context.
In the code below, merge the "outputs" property back in.
Code:
updateDataModel : function (filterCriteria, operation, context) {
// tell the ResultSet/ResultTree the filter changed
if (this.logIsDebugEnabled()) {
this.logDebug("Setting filter to: " + this.echoFull(filterCriteria));
}
// update the context - this allows requestProperties like "showPrompt" / textMatchStyle
// to change
var resultSet = this.getData();
// Handle the grid being grouped
if (!this.dataObjectSupportsFilter(resultSet)) resultSet = this.originalData;
if (!this.dataObjectSupportsFilter(resultSet)) {
return;
}
///////////////////////////////////////////////////////////////////////////////////////
// Patch to keep non-changeable requestProperties
if(resultSet.context) {
// apply non-changeable requestProperties
if(resultSet.context.outputs) context.outputs = resultSet.context.outputs;
}
///////////////////////////////////////////////////////////////////////////////////////
resultSet.setContext(context);
// if the ResultSet won't kick off an immediate fetch, kill the afterFlowCallback
// This is the callback passed into fetchData(...) and would normally be cleared by
// ResultSet.fetchDataReply()
// If we don't clear it here, the next time a fetch occurs (EG via 'invalidateCache()') the
// callback will occur (once) when that fetch completes.
if (!resultSet.willFetchData(filterCriteria)) delete context.afterFlowCallback;
resultSet.setCriteria(filterCriteria);
return resultSet;
}might have already introduced problems in the past.
If merging the context is ok, the ListGrid class could even be extended to request only columns or full data objects by using a flag, so the configuration part in <dataproperties> section would not be needed but is done automatically within the ListGrid class.
Of course Master/Detail features need to be reworked too.
What do you think?
Thank you,
Daniel