Quantcast
Channel: SalesLogix 8.1 – Customer FX
Viewing all articles
Browse latest Browse all 25

More Sorting Options with the SData Based Saleslogix Web Grids

$
0
0

To say the new editable grids in the Saleslogix v8x web client are lightly documented would be a sever understatement.  In fact whenever I try to find any documentation available, search engines inevitably lead me back to my own blog!  Trying to figure out how to get things to work can be a head-to-the-wall-bashing exercise in futility.  I have gleaned a couple of things, namely on how to sort.

The data source is contained in a options variable in a collection called storeOptions.  The code generally looks something like this:

var options = {
                tools: toolConfig,
                columns: columnConfig,
                previewField: ‘LongNotes’,
                storeOptions: {
                    select: [‘Type’, ‘CompletedDate’, ‘UserName’, ‘AccountName’, ‘ContactName’, ‘ContactId’, ‘OpportunityName’, ‘OpportunityId’, ‘Description’, ‘LongNotes’, ‘Timeless’, ‘Result’],
                    resourceKind: ‘history’,
                    sort: [{ attribute: ‘CompletedDate’}]
                },

The select are the Sdata feed property elements to include.

The resourceKind is the Sdata feed.

The sort is the way the data will be sorted on return.  To chnage it you can add a second parameter like:

                    sort: [{ attribute: ‘CompletedDate’,descending : ‘true’}]

 

One alternative way of sorting is independent of the storeOptions, and instead works on the grid control upon rendering.  That kind of code looks like this:

 var grid = new SlxPreviewGrid.Grid(options, this.placeHolder);
            grid.setSortColumn(‘attachDate’);

 

You can add a second parameter switch of true or false which tells you if it is “In Ascending” order.  So to sort in descending you pass false, like:

var grid = new SlxPreviewGrid.Grid(options, this.placeHolder);
            grid.setSortColumn(‘attachDate’, false);


Viewing all articles
Browse latest Browse all 25

Trending Articles