jQWidgets Forums

jQuery UI Widgets Forums Grid Problem with Checkbox check when sortmode:'many'

Tagged: 

This topic contains 7 replies, has 3 voices, and was last updated by  Hristo 5 years, 3 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author

  • ajayetw1987
    Participant

    Hi JQwidgets Team,
    I am facing many problems in Jqxgrid like when sortmode:’many’
    Steps:
    1- Sort or filter any column.
    2- After Sort or Filter Check the checkbox of any row then first Sort/Filter method called many times after cellendedit event call.
    If I check the checkbox of row then cellendedit event should only call.
    Please help me.
    Thanks And Regards,
    Ajay.


    Hristo
    Participant

    Hello ajayetw1987,

    I tested this example and it seems to work fine.
    Could you clarify it?
    Please, try to modify the example above to reproduce the mentioned case after that just fork and send.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com


    ajayetw1987
    Participant

    Hi Hristo,
    I am asking about this Example-
    var data = generatedata(500);
    var source = {
    localdata: data,
    datafields: [{
    name: ‘firstname’,
    type: ‘string’
    }, {
    name: ‘lastname’,
    type: ‘string’
    }, {
    name: ‘productname’,
    type: ‘string’
    }, {
    name: ‘date’,
    type: ‘date’
    }, {
    name: ‘quantity’,
    type: ‘number’
    }, {
    name: ‘price’,
    type: ‘number’
    }, {
    name: ‘available’,
    type: ‘boolean’
    }],
    datatype: “array”
    };

    var adapter = new $.jqx.dataAdapter(source);

    $(“#jqxgrid”).jqxGrid({
    width: 500,
    theme: ‘energyblue’,
    source: adapter,
    editable: true,
    filterable: true,
    sortable: true,
    sortmode: ‘many’,
    columns: [{
    text: ‘First Name’,
    datafield: ‘firstname’,
    width: 90
    }, {
    text: ‘Last Name’,
    datafield: ‘lastname’,
    width: 90
    }, {
    text: ‘Available’,
    columntype: ‘checkbox’,
    datafield: ‘available’,
    width: 80
    }, {
    text: ‘Product’,
    datafield: ‘productname’,
    width: 170
    }, {
    text: ‘Order Date’,
    datafield: ‘date’,
    width: 160,
    cellsformat: ‘dd-MMMM-yyyy’
    }, {
    text: ‘Quantity’,
    datafield: ‘quantity’,
    width: 80,
    cellsalign: ‘right’
    }, {
    text: ‘Unit Price’,
    datafield: ‘price’,
    cellsalign: ‘right’,
    cellsformat: ‘c2’
    }]
    });
    $(“#jqxgrid”).on(“sort”, function (event)
    {
    alert(‘Method Calls multiple times’);
    });

    $(“#jqxgrid”).on(‘cellendedit’, function (event) {
    // event arguments.
    var args = event.args;
    // column data field.
    var dataField = event.args.datafield;
    // row’s bound index.
    var rowBoundIndex = event.args.rowindex;
    // cell value
    var value = args.value;
    // cell old value.
    var oldvalue = args.oldvalue;
    // row’s data.
    var rowData = args.row;
    console.log(“%ccellendedit”, “color: red;”, “value:”, value, “oldvalue:”, oldvalue, “dataField:”, dataField);
    });

    In this example If we apply sort on multiple columns and Check in any row then you can check this event $(“#jqxgrid”).on(“sort”, function (event) will call many times.
    Please check and do the needful.
    Thanks And Regards,
    Ajay K.


    Hristo
    Participant

    Hello Ajay K.,

    Thank you for the clarification and for the feedback.
    I will create a work item for this case.
    If you provide me more details of what you try to achieve then I will try to provide you a solution.
    I look forward to hearing from you.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com


    ajayetw1987
    Participant

    Hi Hristo,

    Could you please provide me details that you have created a work item for this case.

    As I am using Custom sorting and Custom filtering,Custom Grouping and also add some logic in these events and also bind grid with custom data so I am unable to work with functionality If we apply sort on multiple columns and Check in any row then you can check this event $(“#jqxgrid”).on(“sort”, function (event) will call many times.

    I am also facing many problem with some steps-

    Case 1)- If applyFirst grouping then apply second operation apply multiple columns sort.
    OR
    Case 2)- If first apply multiple sort and Then apply operation grouping.

    In both case first operation’s information gets remove and we only have second operation information with grid and Grouping and sorting events call many times.

    Note- Previously I have only mentioned one issue like– “If we apply sort on multiple columns and Check in any row then you can check this event $(“#jqxgrid”).on(“sort”, function (event) will call many times“.

    Please check and do the needful.

    Thanks And Regards,
    Ajay K.


    Hristo
    Participant

    Hello Ajay K.,

    It will be fixed and it should be included in the next release.
    Please, provide us with more details about the second case with grouping.
    I would like to ask you to provide us with an example that demonstrates this.
    I look forward to hearing from you.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com


    ajayetw2009
    Participant

    Hi Hristo,

    For Case 2)– If first apply multiple sort and Then apply operation grouping.I am sending you link-

    https://jsfiddle.net/ajayetw2009/x0sj7vtz/31/ so you can check and this will demonstrate Case 2 with Example.

    Thanks And Regards,
    Ajay K.


    Hristo
    Participant

    Hello Ajay K.,

    It invokes the sort event again as many times as the number of sorted columns.
    This happens because after grouping the jqxGrid is rerendered.

    Could you clarify what you want to achieve?
    Maybe I could provide you a suitable solution.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.