【问题标题】:Sorting Datatable in Descending Order按降序对数据表进行排序
【发布时间】:2016-12-21 07:30:21
【问题描述】:

我有一个包含 Brand、Section、Color、Len.、Section Type、desc.、Wt、Qty、Rate、Total、Storage、Action 列的数据表

当我将数据保存到表中时,我想在顶部获取最新数据,然后是数据表中的旧数据。现在我没有在数据表中获取排序数据,即使我从模型和控制器。

我的脚本如下所示:

 $(document).ready(function(){
    $('#bar_list').dataTable( {

        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": App.settings.basePath + "inventory/requisition/barlist"
        +"/type/<?php echo $this->type; ?>/id/<?php echo $this->id; ?>"
        +"/barFilterSection/<?php echo $this->filterSection; ?>"
        +"/barFilterColor/<?php echo $this->filterColor; ?>"
        +"/barFilterLength/<?php echo $this->filterLength; ?>"

    });

如何在不指定列的情况下在数据表中按降序显示数据?

【问题讨论】:

    标签: jquery datatables


    【解决方案1】:
    $(document).ready(function(){
    $('#bar_list').dataTable( {
        "order": [[ INDEX_NO_COLUMN, SORT_TYPE ]],
        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": App.settings.basePath + "inventory/requisition/barlist"
        +"/type/<?php echo $this->type; ?>/id/<?php echo $this->id; ?>"
        +"/barFilterSection/<?php echo $this->filterSection; ?>"
        +"/barFilterColor/<?php echo $this->filterColor; ?>"
        +"/barFilterLength/<?php echo $this->filterLength; ?>"
    
    });
    

    Refer Link

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-15
      • 1970-01-01
      • 2014-02-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多