EasyUI Forum
April 23, 2024, 02:28:39 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: datagrid + set all values to a specific value  (Read 1409 times)
rezzonico
Full Member
***
Posts: 182


View Profile
« on: July 26, 2022, 04:04:38 AM »

Hi all,

I need to write a javascript in order to set all values of the first column of a datagrid to a specific value.
I am able to loop throught a datagrid with "getRows", but how to modify the values ?

Thanks
Miche
« Last Edit: July 26, 2022, 05:38:55 AM by rezzonico » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: July 27, 2022, 01:32:49 AM »

The code below shows how to modify all the 'itemid' field values.
Code:
var dg = $('#dg');
var data = dg.datagrid('getData');
data.rows.forEach(row => {
row.itemid = row.itemid + ' new';
});
dg.datagrid('loadData', data);
Logged
rezzonico
Full Member
***
Posts: 182


View Profile
« Reply #2 on: August 19, 2022, 04:37:21 AM »

Thanks !

Regards
Miche
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!