i'd like to do something like
<th field="budget" sortField="budgetValue" width="20%">Budget</th> <th field="expenditures" sortField="expendituresValue" width="20%">Expenditures</th>
i'd like to do something like
<th field="budget" sortField="budgetValue" width="20%">Budget</th> <th field="expenditures" sortField="expendituresValue" width="20%">Expenditures</th>
I've found from looking through the forums that the following code allows you to setup a custom comparator to a field within a data store.
In my field definition, the field offset describing where the field's data is located in the data table is different from the index into the field array. For example
column_defs = [
{fieldname: 'MRLINEID', name: 'ID', field: 4, compare: idCompare },
{fieldname: 'CHANGEDATE', name: "ChangeDate", field: 1, compare: sortNumber},
{fieldname: 'DESCRIPTION', name: "Description", field: 7, compare: descCompare}];
var model = new dojox.grid.data.Table(column_defs, data);
grid.setModel(model);in this case,
data[row][4] is the MRLINEID data and
Hi All,
I am working with grid - ItemFileReadStore (Dojo 1.1.1). By default all columns of the grid are sortable...
However columns that use get and not field are not sortable. Thank you all in advance for your inputs.
In the above snippet Is Active column is NOT sortable...
Regards,
Yazad
Hi All,
I would like to disable sorting on a specific column. Could someone shed come light on how this can be achieved?
Regards,
Yazad K
Hi
Like in topic, i need to display sorted grid table, but disable sorting and ordering by users. Sorting list was easy:
But, i don't know how to disable sorting for users :/
is not working :(
Any ideas?
Hi,
When I tried to update my application from dojo 1.0.2 to dojo 1.1.0rc1 version i encountered a problem.
I am retrieving the grid data from a servlet using the dojox.data.QueryReadStore.
When I am trying to sort the table in the client side using clientSort=true all the grid data disappear and
I stay with an empty grid
The same code is working on dojo 1.0.2 version.
Here is the grid definition code:
I have a grid using an ItemFileReadStore (actually same thing happens with a QueryReadStore and doClientPaging=true) with a moderately large (600 record x 9 field) dataset.
Performance stinks with Firefox, and is decent with Microsoft Internet Explorer, but that's not the issue.
When I click on a column header to reverse sort, the grid seems to be quite "confused". Scrolling causes even more confusion.
(See next response - I've editing this after adding sequential numbers to the dataset to get a better picture of what's happening.)
It seems that sorting on a column in a Grid does not work as I would expect when some of the cells in the column are empty. I have a Grid in which some of the fields are only populated for some rows. Sorting on columns with data in every row works fine, but when I sort on the columns with patchy data, the rows do get re-ordered, but in an apparently semi-random fashion, with the blank values scattered through the column, and even the rows with real values not ordered in any obvious way.
i) is this a known problem? (I searched but couldn't find anything.)
It would be nice to have in the compare function a refernce to the row numbers.
Instead of:
model.fields.get(0).compare = function(a, b){
return (b > a ? 1 : (a == b ? 0 : -1));
}
Maybe something like:
model.fields.get(0).compare = function(a, b, aRow, bRow){
return (b > a ? 1 : (a == b ? { ... sub sort logic ... } : -1));
}
This way, when sorting by column 0 (for example) I could programmatically do a sub sort by any other column.