Our blazing fast Grid component built with pure JavaScript


Post by kamran812 »

Hi,
How we can set a values of grid store specific row on the basis of row id's (parentIndex). Can you please provide an example code.


Post by kamran812 »

this is a little urgent please.


Post by tasnim »


Post by kamran812 »

Hi Tasnim,

I think yes, but how to change the other values present in that row. Basically we want to change the id's which are auto generated and replace them with the id's coming from the DB by ajax response/ result and save in grid store. So that if we remove the record on the bases of id it will remove it from DB without refreshing the page.

Looking for the reply.
Thank you


Post by tasnim »

You could set the id of the row like this

grid.getRowFor(recordOrId).id = 'yourcustomid';

Post by kamran812 »

This is replacing the id's but we are facing an unusual behavior can we have a 5, 10 mins session ? By this you can see what we were doing wrong?
Once I replace the id's through loop then I cannot select the newly added rows, looks like they are locked thats why I can not remove these records. On refresh everything is fine.


Post by tasnim »

Sorry, but calls are not possible in the bounds of forum support. Only as Professional Services https://www.bryntum.com/services

what if you try this instead

grid.store.getById(x).id = 'customid'

Post by kamran812 »

Can you please have a look at my code ? I'm adding a file. in which the Grid code is present.
Please see the video attached as well. If I replace the auto generated id's with actual id's coming in result of ajax call then this happens.

Attachments
Britvic.mp4
(1.03 MiB) Downloaded 17 times
for bryntum grid forum.zip
(4.29 KiB) Downloaded 20 times

Post by tasnim »

Have you tried the approach I provided above? I can not run your application but

grid.store.getById(x).id = 'customid'

Should be working for you.

I've tested that with our online example here https://bryntum.com/products/grid/examples/php/ And it works.


Post by kamran812 »

I'm able to get the records and replace the id's by this getAt() function by not with getById

 		   var countStart = updateModifiedRowsReturn[0].row_id;
                    console.log('2222222 getAt :', grid.store.getAt(countStart));
                    console.log('999999999 getById', grid.store.getById(countStart));

Replacing the auto generated id's like this

	for(var i = countStart, j = 0; i < grid.data.length; i++, j++) {
                    console.log('loooppppp value', j, 'i value', i);
                    grid.store.getAt(i).data.id = updateModifiedRowsReturn[j].sub_job_id;
         }
Attachments
Screenshot 2023-01-19 180800.png
Screenshot 2023-01-19 180800.png (16.99 KiB) Viewed 358 times

Post Reply