Hi,
Through a hierarchical menu system designed from a nested list, specific actions are run for every menu item. (Refer to Displaying Hierarchical Data in a List videos)
In one action, I've been trying to add a new detail view record in the disconnected list and assign the value 'Header' to the control fieldtype & the value of the nested row number in the list to that new detail view record's FieldOrder control. I tried different scenarios. The thought process was that when a new record is inserted, it is then automatically selected, hence the selection[0]+1 would give me the actual row number but it doesn't; this following code when run, it inserts the fieldtype to the new record but gives me a NaN (not a number) for rowNum!
From my understanding, I though that the code for grabbing the row number is run before the new detail view was added for some reason, so I tried the A5.executeThisThenThat(1stFunction,2ndFunction,3rdFunction) and got the same error and behavior!
Then I tried to assign the value of the renderIndex (plus one) to the rowNumber by following David's solution in this post but I received the error that _dataObj[0] is undefined. In the debugger, it shows that there is no new detail view record that was added at the first place when that code is run although it is set to run synchronously after the function that creates a new detail view (only the two objects that are already pushed in the server exist.)
How do I set the value of FieldOrder of the newly added detail view of a disconnected list from an action that resides in another list acting as a hierarchical menu?
Any ideas on why this is happening would be much appreciated.
Thank you
Through a hierarchical menu system designed from a nested list, specific actions are run for every menu item. (Refer to Displaying Hierarchical Data in a List videos)
In one action, I've been trying to add a new detail view record in the disconnected list and assign the value 'Header' to the control fieldtype & the value of the nested row number in the list to that new detail view record's FieldOrder control. I tried different scenarios. The thought process was that when a new record is inserted, it is then automatically selected, hence the selection[0]+1 would give me the actual row number but it doesn't; this following code when run, it inserts the fieldtype to the new record but gives me a NaN (not a number) for rowNum!
Code:
if (action == 'action_1') { var lObjj = {dialog.object}.getControl('LIST_A'); lObjj.newDetailViewRecord(); {dialog.object}.setValue('fieldtype','Header'); var rowNum = Number(lObjj.selection[0])+1; {dialog.object}.setValue('FieldOrder',rowNum); lObjj.updateListFromUXControls(); alert(rowNum); }
Then I tried to assign the value of the renderIndex (plus one) to the rowNumber by following David's solution in this post but I received the error that _dataObj[0] is undefined. In the debugger, it shows that there is no new detail view record that was added at the first place when that code is run although it is set to run synchronously after the function that creates a new detail view (only the two objects that are already pushed in the server exist.)
How do I set the value of FieldOrder of the newly added detail view of a disconnected list from an action that resides in another list acting as a hierarchical menu?
Any ideas on why this is happening would be much appreciated.
Thank you
Comment