Author Topic: Set isDirty Manually  (Read 25 times)

nlabourdette

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 1
    • View Profile
Set isDirty Manually
« on: June 04, 2019, 08:05:20 pm »
I have a situation where I am updating rows in a grid with the updateRow method, but those rows aren't getting flagged as dirty for isDirty() checks.  Is there any way to programmatically set the dirty flag on those rows/cells?  Below I'll show an example of a call that isn't working for me right now.  Because the updateRow changes aren't being flagged as dirty, this if statement fails and my updates aren't being passed to my controller. 

        if (!$.active && !grid.getEditCell().$cell && grid.isDirty() && grid.isValidChange({ focusInvalid: true }).valid) {

            let gridChanges = grid.getChanges();

       }

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 3911
    • View Profile
Re: Set isDirty Manually
« Reply #1 on: June 04, 2019, 10:19:56 pm »
Please set primary key ( dataModel.recIndx ) of the dataset and trackModel.on to true

https://paramquery.com/pro/api#option-dataModel-recIndx

https://paramquery.com/pro/api#option-trackModel