Inevitably, some Developers need to apply advanced business and content manipulation rules to web/portal pages that display collections of Salesforce records.
This trick of using Javascript Arrays works very well. The basic components of this pattern are:
- Create a Javascript object that mirrors the Salesforce object and fields to be managed
- Use a Dialogue Script Repeater control to select a collection of records from Salesforce and package them into a client-side Javascript array.
- Render the web page using the Javascript collection of objects.
Very powerful technique. I can foresee the need to extend DScript controls to return results in a format such as JSON, which is already in use in our AJAX library.
You can view a source code example in the Developer Sandbox.