How can I do this.
How can I do this.
I have a problem that I don't know how to solve.
I have got some suggestion from this forum but none of these has worked.
First of all when I click on a div I pass data to JQuery_UI dialog in this way
this.id is 10_100_3
$("#dlgBooking").data("id", this.id).dialog({
width: 230
});
It's now the problem starts
The dialog that is displayed looks like this. It a vertical menu styled with CSS.
<div id="dlgBooking" title="Booking menu" style="display:none">
<ul class="nav">
<li><a href="javascript:Booking()">Booking</a></li>
<li><a href="javascript:ChangeTime()">Change time</a></li>
<li><a href="javascript:CancelBooking()">Cancel booking</a></li>
<li><a href="javascript:Createlocking()">Create locking</a></li>
<li><a href="javascript:Removelocking()">Remove locking</a></li>
</ul>
</div>
If the dialog had some buttons as in this example.Here we have a OK and a cancel button
If I click the OK button the passed data is displayed which is "10_100_3
$("#dlgBooking").dialog({
resizable: false,
height: 200,
width: 400,
modal: true,
autoOpen: false,
buttons:
{
"OK": function ()
{
var myid = $(this).data("id");
$(location).attr('id', myid);
$(this).dialog("close");
alert(myid);
}
Cancel: function ()
{
$(this).dialog("close");
}
}
});
So my question is if it's possible to extract the passed value from the JQuery-Ui dialog when the JQuery-UI dialog is displayed.
I could then save this value in a global variable.
The best solution would be if it's possible to pass the value into the function that is associate with the menu alternatives that exist in the JQuery-UI dialog.
So assume I select Booking then it would be nice if I could find 10_100_3 in the Booking function.
//Tony