Title: cell "format" as an attribute of column in datagrid Post by: mshaffer on December 12, 2016, 10:17:51 AM Hi,
I am trying to sort data that I have built in HTML... The sorting is "as a string"... that is "73" and "7" are before "6"... In your data examples, when you put in the data field, it works as expected, but in the table format, it does not. In the data examples, you can do "type of" ... which is not possible with table, so I propose adding type-of as a column attribute Code: if(typeof(data) == 'number') In the same vain, your sorter: true, with asc and desc ... you should also have default methods of "alpha" or "numeric" with custom functions to override. Code: field:'freq', align: 'center',sortable:true, order:'desc', format:'number' Title: Re: cell "format" as an attribute of column in datagrid Post by: jarry on December 12, 2016, 05:09:14 PM The 'sorter' function can be used to custom your sort on a field. The code below shows how to sort a 'date' field.
Code: $('#dg').datagrid({ Title: Re: cell "format" as an attribute of column in datagrid Post by: mshaffer on December 12, 2016, 05:39:53 PM Yes, that was my workaround after finding out "table data" and "direct data" behave differently.
|