Show Posts
|
Pages: [1] 2
|
1
|
General Category / General Discussion / no data on dialog box when user update data
|
on: July 27, 2014, 07:19:29 PM
|
hi guys, I'm getting frustrated about my work, on my local computer it's working fine but when I decided to put it in the live server this what happens when I click update button a dialog box opens but no value is selected all input fields is empty here is my dialog and js code
function editUser(){ var row = $('#dg').datagrid('getSelected'); if (row){ //mdid = row.system_md_id; /*$('#dg2').datagrid({ url:'get-clinic.html?clinid='+row.system_md_id }); $('#dg2').datagrid('reload', { clinid:row.system_md_id });*/ $('#dlg').dialog('open').dialog({ title: 'Edit Vet', width: 1344, height: 635, closed: false, cache: false, modal: true, resizable: true }); $('#fm').form('load',row); url = 'update-vet.html?id='+row.system_md_id; }
|
|
|
4
|
General Category / General Discussion / clear all
|
on: July 23, 2014, 11:14:16 PM
|
hi guys, how can I clear all the value when I click the add new row in datagrid every values in form and clear datagrid also? Am having a trouble clearing the rows in datagrid here is my code function newUser(){ $('#dlg').dialog('open').dialog({ title: 'New Vet', width: 1344, height: 635, closed: false, cache: false, modal: true, resizable: true }); $('#fm').form('clear'); $('#dg2').datagrid('reload'); url1 = 'save-vet.html'; }
thank you very much
|
|
|
6
|
General Category / General Discussion / datagrid functions
|
on: July 23, 2014, 06:49:35 PM
|
hi guys, I just wanna ask a question I have 6 function, add/edit/save for user and add/edit/save for clinic here's the code for users function newUser(){ $('#dlg').dialog('open').dialog({ title: 'New Vet', width: 1344, height: 635, closed: false, cache: false, modal: true, resizable: true }); $('#fm').form('clear'); url1 = 'save-vet.html'; //........
function editUser(){ var row = $('#dg').datagrid('getSelected'); if (row){ $('#dg2').datagrid({ url:'get-clinic.html?clinid='+row.system_md_id }); $('#dlg').dialog('open').dialog({ title: 'Edit Vet', width: 1344, height: 635, closed: false, cache: false, modal: true, resizable: true }); $('#fm').form('load',row); url1 = 'update-vet.html?id='+row.system_md_id; //........
function saveUser(){ $('#fm').form('submit',{ url: url1, onSubmit: function(){ return $(this).form('validate'); }, success: function(result){ var result = eval('('+result+')'); if (result.errorMsg){ $.messager.show({ title: 'Error', msg: result.errorMsg }); } else { $('#dlg').dialog('close'); // close the dialog $('#dg').datagrid('reload'); // reload the user data $('#dg').datagrid('reload'); // reload the user data } } }); }
for clinic function newclinic(){ $('#clinimain').dialog('open').dialog({ title: 'Add Clinic', width: 500, height: 500, closed: false, cache: false, modal: true, resizable: true, closable: false }); $('.clearinfo').val(""); url2 = 'save-clinic.html'; } function editclinic(id){ var row = $('#dg2').datagrid('getSelected'); if (row){ $('#clinimain').dialog('open').dialog({ title: 'Edit Clinic', width: 500, height: 500, closed: false, cache: false, modal: true, resizable: true, closable: false });
$('#fm2').form('load',row); url2 = 'update-clinic.html?id='+row.system_company_clinic_id; }else{ alert("Please Select A Record To Modify!"); } }
function saveClinic(){ $('#fm2').form('submit',{ url: url2, onSubmit: function(){ return $(this).form('validate'); }, success: function(result){ var result = eval('('+result+')'); if (result.errorMsg){ $.messager.show({ title: 'Error', msg: result.errorMsg }); } else { $('#clinimain').dialog('close'); // close the dialog $('#dg2').datagrid('reload'); // reload the user data $('#dg2').datagrid('reload'); // reload the user data } } }); }
My question is I change variable url in add/edit for each account into url1 for user and url2 for clinics , is it safe to change these variable? thank you very much!
|
|
|
8
|
General Category / General Discussion / Re: pass id from datagrid to datagrid under dialog box
|
on: July 21, 2014, 01:33:01 AM
|
hi guys, for the sake of others here's what I've done <table id="dg2" class="easyui-datagrid" style="width:auto;max-width:1300px;height:auto" rownumbers="true" fitColumns="true" singleSelect="true" autoRowHeight="false"> <thead> <tr> <th field="company_clinic_name" width="30" sortable="true">Clinic Name</th> <th field="Municipality" width="50" sortable="true">Municipality</th> <th field="Province" width="50" sortable="true">Province</th> </tr> </thead> </table>
var row = $('#dg').datagrid('getSelected'); if (row){ $('#dg2').datagrid({ url:'get-clinic.html?clinid='+row.system_md_id }); }
noted! this data grid is inside a edit dialog box my reference is in my first comment Thank you stworthy!!
|
|
|
|