Hi ,
I am evaluating iGX grid and i wanted to do simple functionality of add to favourite. I have favourite button that is bound to favourite property when you click the button i want to toggle [ IsACTIVE] property so to make button favourite / not favourite.
here is the code.
Hello,
I have been looking into the described behavior and created a small sample trying to reproduce it based on the provided code snippet.
If you are changing only the underlying data source, the grid would not detect this as a change. My suggestion in order to achieve your requirement and update the grid is to use the cell's update method. It would set a new value to the cell and call the grid's chageDetectRef markForCheck method in order to update the grid too.
Instead of rowIndex you could pass as argument of toggleFavourite method the cell itself, update its value and take its row. After that you could get the required cell from this row and update it too:
public toggleFavourite(cell: IgxGridCellComponent) { cell.update(!cell.value); let row: IgxGridRowComponent = cell.row; row.cells.forEach(function(cell: IgxGridCellComponent) { if (cell.column.field === "PreviousPrice") { cell.update(cell.value + 1); } }); }
Here could be found my sample for your reference. Please test it on your side and let me know how it behaves. If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me along with steps to reproduce. Alternatively, if the behavior cannot be replicated please feel free to provide your own sample. Remove any external dependencies and code that is not directly related to the issue, zip your application and attach it in this case.
Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.
Thank you for your cooperation.
Looking forward to hearing from you.
Sincerely,
Teodosia Hristodorova
Associate Software Developer
Thank you so much for this. It is working as expected now.