EasyUI Forum
October 16, 2025, 06:19:30 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Change attributes for a specific column on a specific row  (Read 7582 times)
daniel_john
Newbie
*
Posts: 2


View Profile Email
« on: November 08, 2016, 06:28:38 AM »

Hi.

I need to change a specific column of a "Parent" grid if a value is changed in one of the "Child" grid's rows. Needless to say that this is for an editable grid and a gridview.

I am able to change a specif column of all rows of the relevant "Parent" grid.

This is my code:

   var thisGrid = $(this).datagrid('getSelfGrid'); // Get the grid that this row belongs to
   var dgParent = thisGrid.datagrid('getParentGrid'); // Get the parent grid of this grid
   var ndx = $(this).datagrid('getParentRowIndex'); // Get the index of the row of the parent grid that this row belongs to
   var parentRow = $('dgInv').datagrid('selectRow', ndx); // Get the actual row of the parent grid
   var parentColumn = parentRow.datagrid('getColumnOption', 'EditComment'); // Get the specific column
   parentColumn.editor = null; // Make it "not editable" ---- This should only affect the specific column and not all the columns in the grid

Any help will be greatly appreciated.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 10, 2016, 04:34:27 AM »

You can call 'getColumnFields' method to get all the column fields and then empty their 'editor' properties. Please try this code:
Code:
var fields = dg.datagrid('getColumnFields');
for(var i=0; i<fields.length; i++){
var col = dg.datagrid('getColumnOption', fields[i]);
col.editor = null;
}
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!