The reason why the abbr attribute does not exist when the sortable in FlexGrid is set to false and the Solution

Source: Internet
Author: User

When you set a column in the table as follows:

{    display: ‘ID‘,    name: ‘ORDER_ID‘,    width: 40,    sortable: false,    align: ‘left‘}

This column will not have the abbr attribute

To solve this problem

1. Open FlexGrid. js

2. find such a piece of code

if (cm.name && cm.sortable) {    $(th).attr(‘abbr‘, cm.name);}

Change it

if (cm.name) {    $(th).attr(‘abbr‘, cm.name);}

In this way, all columns will have the abbr attribute, but all columns at the same time (even if the value of the sortable attribute is set to false) will still display the sorting effect. How can I delete all the sorting effects?

Find this code

changeSort: function (th) { //change sortorder    if (this.loading) {        return true;    }    $(g.nDiv).hide();    $(g.nBtn).hide();    if (p.sortname == $(th).attr(‘abbr‘)) {        if (p.sortorder == ‘asc‘) {        p.sortorder = ‘desc‘;        } else {            p.sortorder = ‘asc‘;        }    }    $(th).addClass(‘sorted‘).siblings().removeClass(‘sorted‘);    $(‘.sdesc‘, this.hDiv).removeClass(‘sdesc‘);    $(‘.sasc‘, this.hDiv).removeClass(‘sasc‘);    $(‘div‘, th).addClass(‘s‘ + p.sortorder);    p.sortname = $(th).attr(‘abbr‘);    if (p.onChangeSort) {        p.onChangeSort(p.sortname, p.sortorder);    } else {        this.populate();    }},                

Delete it, and then delete the code that calls the function later <this method G. changesort (this) is called in one place;>

You can solve this problem.

 

The reason why the abbr attribute does not exist when the sortable in FlexGrid is set to false and the Solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.