Show Posts
|
Pages: [1]
|
3
|
General Category / EasyUI for jQuery / How display Datagrid two different column value joining with same Master table
|
on: April 23, 2019, 10:45:16 PM
|
I have tabel Details table contain field1 and field2 both having value of Master table id and text, now how display this value in datagrid.
e,g
Master Table Details Table Result Need in Datagrid Id Text Field1 Field2
1 John 1 2 John Embross 2 Embross 2 1 Embross John 3 Peter 3 1 Peter John
if I have change in select command pls. help me my sql is select * from details where field1= id and field2 = id but it is not giving me any value.
Naresh
|
|
|
5
|
General Category / Bug Report / Button in Datagrid fire before select row
|
on: April 22, 2019, 06:33:11 AM
|
I have used Link Button in the datagrid in particular column, after clicking this button Modal will open with textbox where I can put more line instead writing in datagrid textbox, if user in edit mode the textbox will display store value, but while button click without selecting any row the row index value is not getting, in this user have to select Row first so index get return according stored data can display in textbox.
Please help, to solve this problem.
|
|
|
6
|
General Category / General Discussion / Re: I need help to get cell value
|
on: January 19, 2016, 02:58:45 AM
|
Please check this code what is wrong in this code and help me. $(function(){ $('#dg').datagrid({ view: detailview, detailFormatter:function(index,row){ return '<div style="padding:2px"><table id="ddv-' + index + '", class="easyui-datagrid"></table></div>'; }, onExpandRow: function(index,row){ $('#ddv-'+index).datagrid({ method: 'get', url:' http://192.168.1.212/pm/Data/Purchase_Enquiry/Enquiry_Data.php?Indent_Srno='+row.Indent_Srno, fitColumns:false, onClickCell: onClickCell, singleSelect:true, rownumbers:true, loadMsg:'', height:'auto', toolbar: [ { id : 'add', text : 'Add', iconCls: "icon-add", plain : true, handler: function(){ $('#ddv-'+index).datagrid('appendRow',{status:'P'}); editIndex = $('#ddv-'+index).datagrid('getRows').length-1; $('#ddv-'+index).datagrid('updateRow',{//This is to update Ident_Srno column index: editIndex, row: { Indent_Srno: row.Indent_Srno, Indent_Quantity:row.Indent_Quantity } }); $('#ddv-'+index).datagrid('selectRow', editIndex) .datagrid('beginEdit', editIndex); } //$( '#dg' ).datagrid( 'addRow' ) } },{ id : 'save', text : 'Save', iconCls: "icon-save", plain : true, handler: function(){ var Enquiry_Det=[]; $('#ddv-'+index).datagrid('endEdit', editIndex); rows= $('#ddv-'+index).datagrid('getRows'); for(var i=0; i<rows.length; i++) { if (rows .Purchase_Enquire_Srno==undefined) { rows.Purchase_Enquire_Srno='0'; // This is to know it new entry } if (row.Indent_Quantity <= rows.Order_Qty) { rows.Status='Ordered'; // This is to know it new entry } else if ('0'== rows.Order_Qty) { rows.Status='InProcess'; } else if (row.Indent_Quantity > rows.Order_Qty) { rows.Status='Partial Order'; } var str = rows.Account_Srno+"@"+rows.Rate +"@"+rows.DiscPercent+"@"+rows.DiscAmount +"@"+rows.Packing+"@"+rows.Excise+ "@"+rows.Advance+"@" +rows.Traspotation +"@"+ rows.Tax+"@"+ rows.PayDay+"@"+ rows.Remark +"@"+rows.Indent_Srno +"@"+ rows.Purchase_Enquire_Srno+"@"+today+"@"+getParameterByName("User") +"@"+ rows.Status +"@"+ rows.Order_Qty; Enquiry_Det.push(str); } $.ajax({ type: "POST", url: 'http://192.168.1.212/pm/Data/Purchase_Enquiry/Purchase_Enq_Save.php', data: {"Enquiry_Det[]": Enquiry_Det}, success: function(){ editIndex = undefined; $('#dg').datagrid('collapseRow', index); refresh(); //$('this').datagrid('collapseRow',0); //alert('Data Saved'); }, error: function(){ alert('This Item Already Exist'); } }); } }], columns:[[ {field:'Account_Srno', title:'Vendor',width:200, formatter:function(value,row){ return row.Name;}, editor:{ type:'combobox', options:{ valueField:'Account_Srno', textField:'Name', url:'http://192.168.1.212/pm/Data/Account_Data/Account_Data_Indent.php', required:true, panelHeight:'350', filter: function(q,row){ var opts = $(this).combobox('options'); return row[opts.textField].toUpperCase().indexOf(q.toUpperCase()) >= 0} } } }, {field:'Order_Qty',title:'Order Qty.',width:80,align:'right',editor:'numberbox'}, {field:'Rate',title:'Rate',editor:'numberbox',width:80}, {field:'DiscPercent',title:'Disc. (%)', width:80,align:'right',editor:{type:'numberbox',options:{precision:2}}}, {field:'DiscAmount',title:'Disc. Amount',width:80,align:'right',editor:'numberbox'}, {field:'Packing',title:'Packing',width:80,align:'right',editor:'numberbox'}, {field:'Excise',title:'Excise (%)',width:80,align:'right',editor:{type:'numberbox',options:{precision:2}}}, {field:'Tax',title:'Tax',width:120, editor:{ type:'combobox', options:{ valueField:'text', textField:'text', data:[ {'text':'Vat 12.5%'}, {'text':'Vat 5%'}, {'text':'2% & C Form'}, {'text':'H Form'} ] }}}, {field:'Traspotation',title:'Traspotation',width:100,align:'left',editor:'textbox'}, {field:'Advance',title:'Advance',width:80,align:'right',editor:'numberbox'}, {field:'PayDay',title:'Payment',width:150, editor:{ type:'combobox', options:{ valueField:'text', textField:'text', data:[ {'text':'15 Days'}, {'text':'30 Days'}, {'text':'45 Days'}, {'text':'60 Days'}, {'text':'90 Days'}, {'text':'Against Delivery'}, {'text':'As Usual'} ] }}}, {field:'Remark',title:'Remark',width:250,align:'left',editor:'textbox'}, {field:'Indent_Srno',title:'Indent_Srno',width:80,align:'right',editor:'numberbox',hidden:'true'}, {field:'Status',title:'Status',width:80,align:'right',editor:'textbox',hidden:'true'}, {field:'Indent_Quantity',title:'Indent_Quantity',width:80,align:'right',editor:'numberbox',hidden:'true'}, {field:'Purchase_Enquire_Srno',title:'Purchase_Enquire_Srno',width:80,align:'right',editor:'numberbox',hidden:'true'} ]], onResize:function(){ $('#dg').datagrid('fixDetailRowHeight',index); }, onLoadSuccess:function(){ setTimeout(function(){ $('#dg').datagrid('fixDetailRowHeight',index); },0); } }); $('#dg').datagrid('fixDetailRowHeight',index); } }); }); $('#ddv-'+index).datagrid({ data: data }).datagrid('enableCellEditing').datagrid('gotoCell', { index: 0, field: 'Indent_Srno' }); $.extend($.fn.datagrid.methods, { editCell: function(jq,param){ return jq.each(function(){ var opts = $(this).datagrid('options'); var fields = $(this).datagrid('getColumnFields',true).concat($(this).datagrid('getColumnFields')); for(var i=0; i<fields.length; i++){ var col = $(this).datagrid('getColumnOption', fields); col.editor1 = col.editor; if (fields != param.field){ col.editor = null; } } $(this).datagrid('beginEdit', param.index); for(var i=0; i<fields.length; i++){ var col = $(this).datagrid('getColumnOption', fields); col.editor = col.editor1; } }); } }); var editIndex = undefined; var Edit_Data_URL ='http://192.168.1.212/pm/Data/Account_Data/Vendor.php?Account_Srno='; function endEditing(ddv){ if (editIndex == undefined){return true} if (ddv.datagrid('validateRow', editIndex)){ var editno = editIndex; ddv.datagrid('endEdit', editIndex); editIndex = undefined; rows= ddv.datagrid('getRows'); if (isNaN(rows[editno].Account_Srno)==false){ Edit_Data_URL='http://192.168.1.212/pm/Data/Purchase_Enquiry/Vendor.php?Account_Srno='+rows[editno].Account_Srno;
$.ajax({ type: "GET", url:Edit_Data_URL, dataType: 'json', success: function(data){ $(ddv).datagrid('selectRow', editno) .datagrid('editCell', {index:editno,field:Name}); ddv.datagrid('updateRow',{//This is to update Ident_Srno column index: editno, row: { Name: data[0].Name } }); ddv.datagrid('endEdit', editno); } }) } /* ddv.datagrid('updateRow',{//This is to update Ident_Srno column index: editno, row: { DiscAmount: DiscPercent } }); */ return true; } else { return false; } }
function onClickCell(index, field){ var dg1 = $(this); dg1.datagrid('editCell', {index:index,field:'Name'}); var ed = dg.datagrid('getEditor', {index:index,field:'Name'}); var value = $(ed.target).combobox('getText'); alert(value); if (endEditing($(this))){ $(this).datagrid('selectRow', index) .datagrid('editCell', {index:index,field:field}); editIndex = index; } }
|
|
|
7
|
General Category / General Discussion / Re: I need help to get cell value
|
on: January 18, 2016, 11:41:59 PM
|
same problem I added code for make it editing mode
now my code is below.
$(ddv).datagrid('selectRow', index) .datagrid('editCell', {index:index,field:Name}); var ed = $(this).datagrid('getEditor', {index:index,field:Name}); var WName = $(ed.target).combobox('getText'); alert( WName);
|
|
|
8
|
General Category / General Discussion / I need help to get cell value
|
on: January 18, 2016, 11:19:40 PM
|
function onClickCell(index, field){ var ed = $(this).datagrid('getEditor', {index:index,field:Name}); var WName = $(ed.target).combobox('getText'); alert( WName); } above code is not working I am new pls. help me
|
|
|
|