bdearborn
Newbie
Posts: 19
|
|
« on: March 26, 2013, 06:13:06 PM » |
|
Hello, I am trying to have a combobox run the remote lookup immediately after the form is loaded. Unfortunately, the q parameter is not passed after the form is loaded on the initial lookup. Is there a better way to do this? Here is an example of my code thus far:
$(function() { $('#myForm').form( { onLoadSuccess:function(data) { //load combos $('#patient_id').combobox('reload', '/wservice/?_COMMAND=patient.lookup&q=' + $('#patient_id').combobox('getValue')); $('#physician_id').combobox('reload', '/wservice/?_COMMAND=personnel.lookup&q=' + $('#physician_id').combobox('getValue')); $('#facility_id').combobox('reload', '/wservice/?_COMMAND=facility.lookup&q=' + $('#facility_id').combobox('getValue')); $('#site_id').combobox('reload', '/wservice/?_COMMAND=site.lookup&q=' + $('#site_id').combobox('getValue')); }, onLoadError:function() { //display error alert('There was an error.'); //close the current form doClose_frmCaseMainRecord(); } }); });
<div class="myform"> <label for="patient_id">Patient:</label> <select id="patient_id" name="patient_id" class="easyui-combobox" data-options=" url:'/wservice/?_COMMAND=patient.lookup', valueField:'id', textField:'name', mode:'remote', disabled:true, hasDownArrow:false" style=" width:200px;" /> </div> <div class="myform"> <label for="physician_id">Surgeon:</label> <select id="physician_id" name="physician_id" class="easyui-combobox" data-options=" url:'/wservice/?_COMMAND=personnel.lookup', valueField:'id', textField:'name', mode:'remote', disabled:true, hasDownArrow:false" style=" width:200px;" /> </div> <div class="myform"> <label for="facility_id">Facility:</label> <select id="facility_id" name="facility_id" class="easyui-combobox" data-options=" url:'/wservice/?_COMMAND=facility.lookup', valueField:'id', textField:'name', mode:'remote', disabled:true, hasDownArrow:false" style=" width:200px;" /> </div> <div class="myform"> <label for="site_id">Site:</label> <select id="site_id" name="site_id" class="easyui-combobox" data-options=" url:'/wservice/?_COMMAND=site.lookup', valueField:'id', textField:'name', mode:'remote', disabled:true, hasDownArrow:false" style=" width:200px;" /> </div>
|