Hello,
We have a need to create a very large valueMap that could contain thousands of records. The key here is obviously performance, and the contents of the valueMap are dynamic and could change frequently as the user add,edits, and deletes records in the applicaiton. So, I was reading your documentation about optionDataSource and saw the following text:
I'm not clear on why this offers superior performance for large valueMaps? And, will this method make it possible for me to edit the valueMap without significant performance impact after the user has already loaded the valueMap?
I am currently calling fetchData on my datasource and then, in the callback, creating an client-side valueMap from the fetch. However, with thousands of records, I am getting "script running slowly" messages because of the callback that populates the valueMap and whenever I try to edit the valueMap. So, I'm trying to figure out the best way to manage this valueMap.
Thanks for the help.
We have a need to create a very large valueMap that could contain thousands of records. The key here is obviously performance, and the contents of the valueMap are dynamic and could change frequently as the user add,edits, and deletes records in the applicaiton. So, I was reading your documentation about optionDataSource and saw the following text:
Code:
Unlike the similar use of +{pickList.optionDataSource,optionDataSource} for pickLists, the entire set of related records is fetched, without paging, so this is appropriate only for smaller valueMaps. For very large valueMap situations, such as an accountId field that should show an accountName where there are thousands of accounts, the recommended approach is: declare two fields in the DataSource, eg "accountId" and "accountName". When fetching records for display in a grid, have your server send back values for both fields. in a grid, show only the "accountId" field, and use formatCellValue on the accountId field to display the accountName, eg: formatCellValue:"record.accountName" This approach is superior to, say, having the server return only the display value, because inline editing, the filterEditor, and related forms will be using the appropriate fieldName when saving and filtering. The inline editors and filter fields can be configured to use databound picklists via field.editorProperties and field.filterEditorProperties respectively.
I am currently calling fetchData on my datasource and then, in the callback, creating an client-side valueMap from the fetch. However, with thousands of records, I am getting "script running slowly" messages because of the callback that populates the valueMap and whenever I try to edit the valueMap. So, I'm trying to figure out the best way to manage this valueMap.
Thanks for the help.
Comment