EasyUI Forum
September 14, 2025, 12:55:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: disable/enable sortable property of columns?  (Read 5888 times)
korenanzo
Guest
« on: April 28, 2016, 09:34:56 AM »

Hi,

I need to change the "sortable" property of a column;

I've tried with something like

o.datagrid('options').columns[0][n].sortable=false

it actually disables the action, but the header maintains the "data grid-sort-icon".

Is there a method to politely doing it?

thanks,

Ric
Logged
korenanzo
Guest
« Reply #1 on: May 12, 2016, 08:21:29 AM »

self reply, ForTheRecords Cheesy

I've found the "sortable" is  a column property

so when I switch the mode (sortable=true/false) I must loop the columns data and change them
Code:
	var columns = $('#dg').datagrid('options').columns[0];
for (var i = 0; i < columns.length; i++) {
columns[i].sortable = sortMode;
}

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!