Is there a way possible to add incrementing values when using .create for rows for differnt values
Is there a way possible to add incrementing values when using .create for rows for differnt values
table.button().add(
null, {
text: 'Create Entries',
action: function (e, dt, node, config) {
editor
.create(15, {
title: 'Create Entry',
buttons: 'Add',
formOptions: {
main: {
onSubmit: function (e, action) {
action.submit();
}
}
}
})
.set('editdeliveredBy', 0)
.set('R.createdOn', createdOn)
.set('R.departTime', )
.submit();
table.button(3).enable(false);
},
});
I am creating 15 duplicated entries over here but what i am looking for is i want to add time to R.departTime whose value should be increasing like row 1: 6:05, row 2: 6:10, row 3: 6:15 and such on till 6:45. But, the rest of the data remains same for all 15 rows
This question has an accepted answers - jump to answer
Answers
This example from this thread should help.
It's uses
field().multiSet()
to add different values to the different record.It's only adding different strings in that example, but the same principle would apply when adding a different time offset.
Colin
Thank you, that helped. I used a loop to add differnt time
Also, another thing when i press the button to create the entries the editor modal shows up for about 2-3 seconds and then disappears. Is there a way we can prevent that and just create the entries.
When you call
create()
you can tell it not to show:Allan
Thanks Allan! You are the best !!