I have a TreeView that displays a list of database records. When a user selects a record, I populate a grid with the related record details. The foreign key is sourceid.
I pass the selected record's id like this:
.Read(read => read.Action("AquisitionNotes_Read", "AquisitionNotes").Data("GetCurrentSourceID"))The GetCurrentSourceID function is simply:
function GetCurrentSourceID() { return {sourceid: currentSourceID }; }But when I want to add a new record, how do I get the currentSourceID value into the Post? If I try the obvious:
.Create(update => update.Action("AquisitionNotes_Create", "AquisitionNotes").Data("GetCurrentSourceID"))The value from the editor (0 of course) gets precedence and gets passed.
How do I force my actual sourceid to overwrite the editor's value? Or am I solving the problem in the wrong way?
- Brad