jQWidgets Forums

jQuery UI Widgets Forums Grid how to change the column order

This topic contains 3 replies, has 3 voices, and was last updated by  ivanpeevski 3 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • how to change the column order #121026

    mustafa
    Participant

    hello
    How can I get the sequence number to the beginning?
    thank you

    https://im.ge/i/oPiuXz

    source: adapter,
                selectionmode: 'checkbox',
                width: "100%",
                height: '470px',
                theme: "energyblue",
                pagerrenderer: pagerrenderer,
                rendergridrows: function () {
                    dataadapter.records;
    
                },
                rendergridrows: function () {
                    dataadapter.records;
                },
                ready: function () {
    
                },
                columns: [
                    {
                        text: '', sortable: false, filterable: false, editable: false,
                        groupable: false, draggable: false, resizable: false,
                        datafield: '', columntype: 'number', width: 35,
                        cellsrenderer: function (row, column, value) {
                            return "<div data-serdar='true' style='padding:4px 0px 0px 6px;font-size:14px;margin:4px;position:absolute;'>" + (value + 1) + "</div>";
                        }
                    },
    how to change the column order #121029

    Yavor Dashev
    Participant

    Hi mustafa,

    If you want to change the column order you can use the setcolumnindex method and for this we have an jsfiddle example showcasing this functionality.

    Link to the fiddle: http://jsfiddle.net/jqwidgets/9ePBx/

    Also what exactly you mean by ‘How can I get the sequence number to the beginning?’

    Please, do not hesitate to contact us if you have any additional questions.

    Best regards,
    Yavor Dashev

    Smart UI Team
    https://www.htmlelements.com/

    how to change the column order #121031

    mustafa
    Participant

    hello yavor
    I’m sorry my english is not good

    I want the sequence numbers to appear on the far left
    and The example you gave didn’t work for me.
    error: jqxCore: Invalid parameter ‘[setcolumnindex, SORT, 1]’ does not exist.
    i am using this version : jQWidgets v9.1.6
    thank you

    example

    1 [checkbox] PRODUCT_NAME
    2 [checkbox] PRODUCT_NAME
    3 [checkbox] PRODUCT_NAME
    4 [checkbox] PRODUCT_NAME

    how to change the column order #121035

    ivanpeevski
    Participant

    Hi mustafa,

    Please have a look at the following fiddle to see how to use the setcolumnindex method:
    https://jsfiddle.net/L1hgy4fq/3/
    $('#grid').jqxGrid('setcolumnindex', 'id', 0);
    The first parameter of the method should be the dataField name of the column you want to move to the front. In the example above, it is “id”.
    The second parameter sets the new index of the column. In your case, the index of the sequence numbers column should be set to 0 so that they are on the far left.

    I hope this will be of help!

    If you have any other problems, please do not hesitate to contact us again.
    Best Regards,
    Ivan Peevski
    jQWidgets team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.