Triggering two refreshes with one click
Triggering two refreshes with one click
martinconnollybart
Posts: 21Questions: 8Answers: 1
Hi, I have a table which links to two other tables. I want a select on the first table to trigger loads on the other two tables. If I put both reloads (and supply the linking field value for the associated editor) in the on select event, only the first one happens.
This is my code:
fundTable.on('select', function(){
appTable.ajax.reload();
appEditor.field('TApplications.funderid')
.def(fundTable.row({selected:true}).data().id);
contactTable.ajax.reload();
contactEditor.field('TFunderContacts.funderid')
.def(fundTable.row({selected:true}).data().id);
});
It doesn't matter which way round I put the two table reloads - only the first happens. Is there another way I should be doing this? Thanks.
This question has an accepted answers - jump to answer
Answers
Both
appTable
andcontactTable
should be doing an Ajax reload there.Can you link to a page showing the issue so I can investigate what is going wrong please?
Allan
Hi @allan I can't really - this is currently just on a laptop where I'm developing the application, and I access the laptop from home using Chrome Remote Desktop. If I put a breakpoint in the code there, it goes through the first table reload and then seems to completely ignore the second one. Would it be feasible as an alternative to do the second reload from an event triggered by the first reload?
OK, it's the passing of the parameter to the editor instance that seems to be the problem. I changed the code as follows:
And that all works perfectly now.
Awesome - thanks for the update. Good to hear you've got it working as you need.
Allan