2016-06-23 28 views
1

我已經使用jqx網格來顯示客戶數據。但是,當我去地址欄上的列排序它不工作。我認爲這是因爲地址包含數值。這裏是代碼jqx - 地址欄上的網格排序不工作

var source = { 
      datatype: "json", 
      datafields: [ 
       { name: 'aa', type: 'string'}, 
       { name: 'bb', type: 'string'}, 
       { name: 'cc', type: 'string'} 
      ], 
      url: senddata, 
      sortcolumn: 'create_date', 
      sortdirection: 'desc' 
     }; 



$("#jqxgrid").jqxGrid(
     {columns: [ 
       { text: 'Address', datafield: 'aa', width: '30%' }, 
       { text: 'Total Units', datafield: 'bb', width: '10%' }, 
       { text: 'Extras', datafield: 'cc', width: '14%' } 
      ], 
      ready: function(){$('#jqxgrid').jqxGrid({ pagesizeoptions: page_opt});} 

所以我希望它的第一列(地址),其中一些包含數值在其中的一些起始位置。提前致謝。

回答

2

由於從後端返回地址作爲鏈接(帶錨點),它不起作用。因爲jqx網格考慮整個標籤進行排序。

在創建自定義鏈接並且僅從後端返回地址作爲文本後,它適用於我。