jQWidgets Forums
jQuery UI Widgets › Forums › Scheduler › Setting a value to a jqxComboBox in EditDialogOpen works only the second time
Tagged: jqxComboBox select scheduler
This topic contains 4 replies, has 2 voices, and was last updated by altivec 8 years, 1 month ago.
-
Author
-
May 3, 2017 at 1:06 pm Setting a value to a jqxComboBox in EditDialogOpen works only the second time #93279
Hello,
I am trying to set a value when opening the Dialog box but the first time, nothing’s happen but the second time I open the Dialog, it works …
Did I missed something ?
$("#scheduler").on('editDialogOpen', function(event){ var args = event.args; var appointment = args.appointment; if (appointment != null) { console.log("Edition Rendez-Vous -> "+appointment.customer_id); $("#customer1").jqxComboBox('selectItem', appointment.customer_id); } else { console.log("Nouveau Rendez-Vous"); $("#customer1").jqxComboBox( 'clearSelection' ); } });
Thanks for your help.
Regards,
Aurélien.
May 4, 2017 at 6:13 am Setting a value to a jqxComboBox in EditDialogOpen works only the second time #93286Hi Aurélien,
jqxScheduler does not have ComboBox in the Edit Dialog. It has DropDownList. Even with custom widgets in the edit dialog, you have to use a combination of events EditDialogOpen and EditDialogCreate.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comMay 4, 2017 at 8:39 am Setting a value to a jqxComboBox in EditDialogOpen works only the second time #93291Hi Peter,
Thanks for your reply.
That’s what I am doing, and it works, but I have to open the dialog, then close it and when I reopen it, the combobox is filled with the correct name.
Here is my code in editDialogCreate
customerContainer = "<div>"; customerContainer += "<div class='jqx-scheduler-edit-dialog-label'>Cliente</div>"; customerContainer += "<div class='jqx-scheduler-edit-dialog-field'><div id='customer1'></div></div>"; customerContainer += "</div>"; fields.resourceContainer.append(customerContainer);'
$j(“#customer1”).jqxComboBox({
placeHolder: ‘Choisissez une cliente…’,
width: ‘100%’,
height: 25,
source: dataAdapter_customer,
selectedIndex: -1,
minLength:3,
displayMember: “customer_name”,
valueMember: “customer_id”,
searchMode:’containsignorecase’,
autoComplete:true,
search: function (searchString) {
dataAdapter_customer.dataBind();
},
});`May 5, 2017 at 1:45 pm Setting a value to a jqxComboBox in EditDialogOpen works only the second time #93320Hi again,
I tried in JSEDITOR and it works, so I think that comes from the ajax loading.
Is it possible to test ajax loading with JSEDITOR ?
Indeed, I noticed that on first opening, the value is setted and then the ajax is calling the list of custome and then whos the “Choose customer…” placeholder of the JQwComboBox.
May 9, 2017 at 1:57 pm Setting a value to a jqxComboBox in EditDialogOpen works only the second time #93379Hi,
I finally managed to get this working by using async:false to be sure the list is ready before loading the dialog box, but the fisrt time, it is slowing the opening of the modal box.
Any other solution ?
var source_customer = { datatype: "json", dataFields: [ { name: 'customer_name' }, { name: 'customer_id' } ], id: 'customer_id', type: "GET", async:false, url: '<?URL;?>agenda/getcustomer' };
-
AuthorPosts
You must be logged in to reply to this topic.