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.
-
Author
-
hello
How can I get the sequence number to the beginning?
thank yousource: 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>"; } },
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 DashevSmart UI Team
https://www.htmlelements.com/hello yavor
I’m sorry my english is not goodI 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 youexample
1 [checkbox] PRODUCT_NAME
2 [checkbox] PRODUCT_NAME
3 [checkbox] PRODUCT_NAME
4 [checkbox] PRODUCT_NAMEHi 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 -
AuthorPosts
You must be logged in to reply to this topic.