Hi,
I have a Master/Detail view in a page with two tables #grid and #grid_d. The table #grid_d shows the detail of the selected element in #grid. This is done rendering #grid_d in #grid.onSelectRow(). All info is loaded from a rest service.
The url to get #grid is /developers/ and the url to get #grid_d is /developer/DEV_ID/skills/. Hence when editing a detail row, the update url must be /developers/DEV_ID/skills/SKILL_ID.
In orther to do this, I get the current row_id in #grid.onSelectRow() and create a define function in #grid_d.onclickSubmit() which finaly puts both ids in the url together.
However, this works exactly only the first time, when #grid_d.onclickSubmit() is created first. Afterwards, all calls to #grid_d.onclickSubmit() will have the DEV_ID (row_id) from the first call (whatever you pick first). The SKILL_ID is correct.
I think there is a bug in reseting the function when the #grid_d is rendered for the second time, or is it a problem with the closure. If so, how should I be passing the DEV_ID instead?
In the code below, DEV_ID is the id from the #grid model, and SKILL_ID is the topic.id from the #grid_d model.I used jquery-1.10.2 and 1.9.1,
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top