jQuery Handsontable在特定列上的排序 [英] Jquery Handsontable Sorting on specific columns

查看:629
本文介绍了jQuery Handsontable在特定列上的排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

     **Sorting Issue**

我有一个用于handontable的插件.我正在对列标题进行排序,排序工作正常,但是我需要的是对特定列进行排序.

I have a plugin for the handsontable.I am sorting on the column headers,sorting is working fine,but what i needs is the sorting on the specific columns.

这是可以动手操作的吗?.我整天都在搜索.

Is this possible in handsontable??.I am searching from the whole day.

我有以下代码:

 **Code Section Handsontable**

    var $container = $("#grid");
    $container.handsontable({
        data:myData,
        startRows:10,
        startCols: 22,
        colWidths: [50, 50, 50, 50, 50, 50, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 70, 80, 80, 80],
        width:1380,
        height: 360,
        contextmenu: true,
        rowHeaders: true,
        manualColumnResize: true,
        manualColumnMove: true,
        colHeaders: ["Bold", "Empty", "LN", "Cust", "Leas", "Sub<br/>Cust", "Sub <br/>Leas", "EMC", "Sub <br/>CSO<br/>S", "FA<br/>LN",
        "M", "Non-<br/>Rev", "S Ops<br/>ID", "Sales", "Imp Dir", "Imp Date", "IC", "Mod", "Eng", "Cont-<br/>Date", "Current<br/>Eff",
        "Current<br/>CSOS"],

        columns: [{ data: 0, readOnly: true }, { data: 1, readOnly: true }, { data: 2 }, { data: 3 }, { data: 4 }, { data: 5 }, { data: 6 }, { data: 7 }, { data: 8 }
             , { data: 9 }, { data: 10 }, { data: 11 }, { data: 12 }, { data: 13 }, { data: 14 }, { data:15 }, { data: 16 }, { data: 17 }, { data: 18 }
             , { data: 19 }, { data: 20 }, {data:21}],
        columnSorting: true,
    });

我已将列排序设置为true,可以对特定列进行排序. 我不想对专栏销售进行排序.如果用户单击它,我不想对数据进行排序. 任何有关如何进行这项工作或完成工作的其他方向的建议,将不胜感激.

I have set column sorting to true,can it be done on specific columns. I dont want to sort column sales. If user will click on it i don't want to sort the data. Any suggestions on how to make this work or an other direction to get the job done would be appreciated.

推荐答案

以第五列降序排序

columnSorting: {
    column: 4,
    sortOrder: true


},

这篇关于jQuery Handsontable在特定列上的排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆