Highlighting Added Row

Hi,

With a record selected, I was able to create a copy function to duplicate a record. How would you go about highlight that new record once it is saved?

Thanks for any advice you can give.

Newt

Hi Newt,

Do you want to highlight it after you’ve copied it, before you’ve saved to the server? There is an editPendingBaseStyle and related properties that would accomplish this.

Or are you trying to do something like briefly flash a record after the save completes?

Thanks

Hi,

I am trying to highlight it after I save it to the database. I figured out the grid highlight function but what would the equivalent be for a Form. Do I use the editValuesManager for this?

Thanks and you guys are great.

Newt

Additional Info

Hi,

Just to let you know. I have a grid showing all the records and a form to list individual records as I scroll down the page with form buttons to edit, delete, or save information.

Newt

So where does the highlight appear, in the grid for the record being edited, or in the form itself?

If in the form, what does the highlight look like?

More Info

The scenarios are these:

If I select a record in the grid, the corresponding data is shown in the form.
I can edit, delete this record.

Both in the grid and form view, I have a Copy button and a Add New button.

For the grid, I pretty much figured out the select and deselect by retrieving the current row to be copied and the new row of copied data in the following:

grid.deselectRecord(selectedRecordIndex);
grid.selectRecord(rowNum); <== rowNum is from our grid.saveEdits function

My problem is the form function. The save feature does not return a the row saved, similar to that of the editCompletionEvent rowNum.

Is there something like that to allow me to retrieve the current row listed in the grid after clicking Add New button and Save in the form?

Thanks.

Newt

Gotcha. The best thing to do is look up the record you just saved via primary key, something like:

grid.data.findIndex({ pkFieldName : form.getValue("pkFieldName") })