Our blazing fast Grid component built with pure JavaScript


Post by Webethics »

Hello

I have tried to implement the cell edit feature in the grid and faced the problem.

The problem is I have set the column default value like "N/A". When I edit the cell and update some value then it displays the only "N/A" value in the cell. Not display the updated value in the particular cell.

I have attached the sample code file my concern is if we edit or update the cell value then the cell should display the updated value, not display the old value like "N/A".

Screenshots
https://prntscr.com/112bfcc
https://prntscr.com/112bftc

Thanks

Attachments
sample.js
(1.09 KiB) Downloaded 102 times

Post by mats »

Test case makes no sense, you have a static renderer outputting N/A always. You probably meant something like the below?

renderer({ value }) {
    return value || 'N/A';
}

Post by Webethics »

Okay, do we have any option where we can replace the one specific row in the store?

I have followed the store crud link but not getting any reference to replace the store row.

Link followed:
https://www.bryntum.com/docs/grid/#Core/data/mixin/StoreCRUD

Thanks


Post by alex.l »

Hi Webethics,

Please always create a new topic for every new question. Our full support policy is here viewtopic.php?f=35&t=772

Please try to describe it in more words what do want to achieve. Replace the store row - do you mean edit store record?
Here is the correct link to docs https://www.bryntum.com/docs/grid/#Core/data/Store

https://www.bryntum.com/docs/grid/#Core/data/Store#function-remove
https://www.bryntum.com/docs/grid/#Core/data/Store#function-insert
https://www.bryntum.com/docs/grid/#Core/data/Store#function-getAt
https://www.bryntum.com/docs/grid/#Core/data/Store#function-getById

All the best,
Alex

All the best,
Alex


Post by Webethics »

Hello

According to the requirement, we are displaying the multiple grids on the same page.
If the value of the cell not found then we display the "N/A" text in the cell.

When the user updates the cell value than the updated value not be displayed, after the update value cell displays the "N/A" value only.

So we make a plan in which if any cell value is updated then we replace this particular row with updated row values.
As we checked with the insert option, the insert option inserts the new row on this particular index with updated values.

But we want some functionality where we will replace the complete grid row with an updated grid row.

Thanks


Post by alex.l »

When the user updates the cell value than the updated value not be displayed, after the update value cell displays the "N/A" value only.

I just tried to use the code that Mats provided with basic Grid example (https://bryntum.com/examples/grid/basic/) and it works great - I see "N/A" if no value and the value if I changed it using a cell editor. It would be great if you provide a runnable test case, so we will be able to figure out what's the problem.

We don't have API to "replace a row", but if you want to do that, you can do it with 2 operation: first remove old record and insert a new record after that.
Btw, every record has it's own set method which allows to set all values you need https://bryntum.com/docs/grid/#Core/data/Model#function-set :

grid.store.getAt(5).set({
   name : 'Clark',
   city : 'Metropolis',
   [...]
});

All the best,
Alex


Post Reply