I have created a toolbar for basic database actions: insert, delete etc. It has an onclick event that is handled ok. I would like to be able to dynamically build this toolbar by php. The same code is generated but for some reason the event is not working. I tried firefox developer edition to find out, but it shows me that the original code is bound to events, but the ajax received part isn't. What am I doing wrong
top version is working, the full (green) toolbar isn't (not bound to ev) this part was received by an ajax event
the original html looks like this:
<div class="btn-group" role="group" aria-label="hallo">
<button type="button" id="id_phspapps_dbnavigator_1_add" class="btn btn-default">Add</button>
<button type="button" id="id_phspapps_dbnavigator_1_cancel" class="btn btn-default">Cancel</button>
</div>
</div>
<div id="phid_phspapps_dbnavigator_1">
</div>
In the ondocumentready an event is triggered to retrieve the toolbar data. It looks like the setup ajax event is not bound to the fields. All buttons have their own event, like _add, _cancel as the function below for _edit:
$("#id_phspusers_dbnavigator_1_edit").click(function() {
var str='';
str = $( "#id_"+formid ).serialize();
procbutton(str+'&cmd=edit&sender=id_phspusers_dbnavigator_1','');
});