jQWidgets Forums
Forum Replies Created
Viewing 3 posts - 1 through 3 (of 3 total)
-
Author
-
November 13, 2015 at 1:31 pm in reply to: Cross Site Service call for JxGrid is not working Cross Site Service call for JxGrid is not working #78110
Any luck with this issue? Seem I am facing the same problem here. Please help and thanks
June 26, 2015 at 4:32 am in reply to: loadComplete does not fire. loadComplete does not fire. #73042Hi Peter
Thanks for the response. The problem is I don’t get any error in loadError. I am sure the URL is OK, since I tried manually, it’s work. It’s return in XML format. Here’s the code.
The scenario is I have a grid and want user can do inline editing. When he/she type the product code (column: kd_barang), then will retrieve the data via URL, and put the product name at the second column of grid (column: nm_barang).
Am I missed something? Thanks in advance.
$("#jqxgridPODetail").on('cellendedit', function (event) { var args = event.args; var columnDataField = args.datafield; var rowIndex = args.rowindex; var cellValue = args.value; var oldValue = args.oldvalue; if (columnDataField == "kd_barang") { var source = { datatype: "xml", datafields: [ { name: 'kd_barang' }, { name: 'nm_barang' }, { name: 'hrg_jual' }, { name: 'hrg_beli' }, { name: 'flag_active' }, { name: 'flag_checkstock' } ], record: 'content', url: 'ysoftws.asmx/GetBarangDetail?sKdBarang=' + cellValue }; var dataAdapter = new $.jqx.dataAdapter(source, { loadComplete: function () { var records = dataAdapter.records; var length = records.length; var rows = $('#jqxgridPODetail').jqxGrid('getrows'); var rownumber = rows.length - 1; if (length = 0) { if (record.flag_active != "T") { alert("The code is Not Active. Try again!"); $("#jqxgridPODetail").jqxGrid('setcellvalue', rownumber, "kd_barang", ""); $("#jqxgridPODetail").jqxGrid('setcellvalue', rownumber, "nm_barang", ""); } else { // put the product name and unit price $("#jqxgridPODetail").jqxGrid('setcellvalue', rownumber, "nm_barang", record.nm_barang); $("#jqxgridPODetail").jqxGrid('setcellvalue', rownumber, "qty", 1); $("#jqxgridPODetail").jqxGrid('setcellvalue', rownumber, "hrg_satuan", record.hrg_beli); } } else { alert("Product code not found !!!"); $("#jqxgridPODetail").jqxGrid('setcellvalue', rownumber, "kd_barang", ""); } }, loadError: function (jqXHR, status, error) { alert(error); }, beforeLoadComplete: function (records) { } }); }
June 25, 2015 at 3:33 pm in reply to: loadComplete does not fire. loadComplete does not fire. #73022Hi nja
Did you solve your question, since I am facing a similar case like you.
Please share.Thanks in advance
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)