Easyui Datagird The data that is displayed by default is a character, and you need a custom collation for the collation of the numeric column
If you sort by character 27 is less than 4 it's not what we want.
Solution Solutions
<table id= ' grid ' class= ' Easyui-datagrid ' style= ' width:1100px;height:430px 'URL= ' ajax-index.php?module=<{$module _name}>&action=ajax_reportview_agent_call_report_select& assigned_user_id=<{$assigned _user_id}> 'title= ' list ' iconcls= ' icon-table ' rownumbers= ' true ' fitcolumns= ' true ' singleselect= ' true ' toolbar= ' #toolbar ' remotesort= ' False ' > </table>
<script type= ' Text/javascript ' >//Sort custom Sort by number typefunctionSort_int (A, b) {if(A.length > B.length)return1; Else if(A.length < B.length)return-1; Else if(A > B)return1; Else return-1;}
Show Columns $ (' #grid '). DataGrid ({columns: [[{field:' User_name ', title: ' Agent work Number ', Width:20,align: ' Center '}, {field:' First_Name ', title: ' Agent ', Width:20,align: ' Center '}, {field:' Call_count ', title: ' Total Calls ', Width:20,align: ' Center ', sortable:true, Sorter:sort_int}, {field:' Callout_count ', title: ' Number of exhaled ', Width:20,align: ' Center ', sortable:true, Sorter:sort_int}, {field:' Callin_count ', title: ' Incoming Quantity ', Width:20,align: ' Center ', sortable:true, Sorter:sort_int}, {field:' Callout_time_len ', title: ' Total exhaled time (seconds) ', Width:20,align: ' Center ', sortable:true, Sorter:sort_int}, {field:' Callin_time_len ', title: ' Incoming total time (seconds) ', Width:20,align: ' Center ', sortable:true, Sorter:sort_int}, {field:' Talk_time_len ', title: ' Total Call Duration (SEC ', width:20,align: ' Center ', sortable:true, Sorter:sort_int}, {field:' Avg_talk_len ', title: ' Average talk duration (seconds) ', Width:20,align: ' Center ', sortable:true, Sorter:sort_int}, {field:' Talk_count ', title: ' Total Access ', Width:20,align: ' Center ', sortable:true, Sorter:sort_int}, {field:' Talk_ratio ', title: ' Switching rate ', width:20,align: ' Center '} ]]});</script>
Easyui Datagird Sort by Number type problem