jQWidgets Forums
Forum Replies Created
-
Author
-
August 27, 2013 at 12:13 pm in reply to: Issue in applying toolbar in grid. Issue in applying toolbar in grid. #27787
Hi Dimitar,
The issue is it that the search is not working.
And I am using 2.9.1 version of jQWidgets and jquery-1.10.1.min.js.
I have included jqx-all.js for all the required JavaScript files.
Please guide me regarding this.
Thanks & Regards,
ApekshaAugust 27, 2013 at 11:12 am in reply to: Issue in applying toolbar in grid. Issue in applying toolbar in grid. #27783Hi Dimitar,
I have already tried this but I do not know why it is not working.
Please have a look behind my code and guide me regarding thisvar all_initGrid = function () { gridid = "#all_invoicetable"; //update gridid... //var url = "sampledata/invoice_maindata.php"; //$('#all_invoicetable').jqxGrid('updatebounddata'); var source = { datatype: "json", localdata: all_invoice_data, datafields: [ { name: 'id', type: 'number' }, { name: 'number', type: 'string' }, { name: 'reference', type: 'string' }, { name: 'contact_name', type: 'string' }, { name: 'contact_id', type: 'number' }, { name: 'date', type: 'string' }, { name: 'due_date', type: 'string' }, { name: 'paid', type: 'float' }, { name: 'due', type: 'float' }, { name: 'workflow_status_id', type: 'number' }, { name: 'workflow_status_status', type: 'string' }, { name: 'transaction_type_id', type: 'number' }, ], data: { featureClass: "P", style: "full", maxRows: 20 } //id: 'id', //url: url, //root: 'data' }; var dataAdapter = new $.jqx.dataAdapter(source, { formatData: function (data) { data.name_startsWith = $("#searchField").val(); return data; } }, { async: false, loadError: function (xhr, status, error) { alert('Error loading "' + source.url + '" : ' + error); } }); columnCheckBox = null; var updatingCheckState = false; // initialize jqxGrid $("#all_invoicetable").jqxGrid({ width: '97.7%', autoheight: true, source: dataAdapter, //sortable: true, //enabletooltips: true, altrows: true, pageable: true, pagesizeoptions: ['10', '20', '30', '40', '50'], editable: false, selectionmode: 'none', theme: 'metro', columns: [ { text: 'Id', datafield: 'id', width: '12%', hidden: true }, { text: 'Number', datafield: 'number', width: '12%' }, { text: 'Ref', datafield: 'reference', width: '12%' }, { text: 'To_id', datafield: 'contact_id', width: '12%', hidden: true }, { text: 'To', datafield: 'contact_name', width: '12%' }, { text: 'Date', datafield: 'date', width: '15%' }, { text: 'Due Date', datafield: 'due_date', width: '15%' }, { text: 'Paid', cellsformat: 'f2', datafield: 'paid', width: '8%' }, { text: 'Due', cellsformat: 'f2', datafield: 'due', width: '8%' }, { text: 'Status_id', datafield: 'workflow_status_id', width: '18%', hidden: true }, { text: 'Status', datafield: 'workflow_status_status', width: '18%' }, { text: 'transaction Type', datafield: 'transaction_type_id', width: '18%', hidden: true } ], showtoolbar: true, rendertoolbar: function (toolbar) { var me = this; var container = $("<div style='margin: 5px;'></div>"); var span = $("<span style='float: left; margin-top: 5px; margin-right: 4px;'>Search City: </span>"); var input = $("<input class='jqx-input jqx-widget-content jqx-rc-all' id='searchField' type='text' style='height: 23px; float: left; width: 223px;' />"); toolbar.append(container); container.append(span); container.append(input); var oldVal = ""; input.on('keydown', function (event) { if (input.val().length >= 2) { if (me.timer) { clearTimeout(me.timer); } if (oldVal != input.val()) { me.timer = setTimeout(function () { $("#all_invoicetable").jqxGrid('updatebounddata'); }, 1000); oldVal = input.val(); } } }); } });
Thanks & Regards,
ApekshaAugust 26, 2013 at 8:24 am in reply to: Query regarding grid column. Query regarding grid column. #27676Hi Dimitar,
Can you provide me an example that has both an image and checkboxes in one column of a grid.
Thanks & Regards,
ApekshaAugust 23, 2013 at 5:14 am in reply to: Grid updation is not working properly after deleting a row. Grid updation is not working properly after deleting a row. #27498Hi Peter Stoev,
Thanks for your response it resolved my issue.
Thanks & Regards,
ApekshaAugust 22, 2013 at 11:30 am in reply to: Grid updation is not working properly after deleting a row. Grid updation is not working properly after deleting a row. #27422Hi Peter Stoev,
This my code in which after deleting a row from grid the updaterow function is not working properly.
var debit_editrow;$("#ob_debit_grid").bind('cellclick', function (event) { debit_editrow = event.args.rowindex; });var source_debit = { datatype: "json", localdata: debit_account_list, datafields: [{ name: 'check', type: 'string' }, { name: 'opening_balance', type: 'float' }], id: 'id', // url: url, root: 'data', addrow: function (rowid, rowdata, position, commit) { // synchronize with the server - send update command // call commit with parameter true if the synchronization with the server is successful // and with parameter false if the synchronization failder. commit(true); }, deleterow: function (rowid, commit) { // synchronize with the server - send delete command // call commit with parameter true if the synchronization with the server is successful //and with parameter false if the synchronization failed. commit(true); } }; var dataAdapter_debit = new $.jqx.dataAdapter(source_debit); // initialize jqxGrid $("#ob_debit_grid").jqxGrid({ width: '40%', source: dataAdapter_debit, theme: 'shinyblack', autoheight: true, altrows: true, //enabletooltips: true, showaggregates: true, showstatusbar: true, statusbarheight: 0, editable: true, columns: [ { text: 'Account', columntype: 'combobox', datafield: 'check', createeditor: function (row, column, editor) { // assign a new data source to the combobox. var account = dc_account2; editor.jqxComboBox({ source: account, selectedIndex: 0 }); $(editor).on('open', function (event) { //changed from change to open event so that no event get fired unless dropdown is open.. $(editor).on('select', function (event) { //changed from select to change event on select event even on clicking this combobox event was firing... var args = event.args; if (args) { var item = args.item; var item_id = null; item_id = item.label; // console.log(item_id); //code to fetch and populate the row for selected item... if ((item_id !== undefined) && (item_id !== -1)) { for (var s = 0; s < displayed_charts_list2.length; s++) { var debit_balance = {}; if (displayed_charts_list2[s].check == item_id) { debit_balance.opening_balance = displayed_charts_list2[s].opening_balance; //console.log(displayed_charts_list2[s]["opening_balance"]); var opening_balance_value = { opening_balance: debit_balance.opening_balance }; $('#ob_debit_grid').jqxGrid('updaterow', debit_editrow, opening_balance_value); } } } } }); }); }, width: '55%' }, { text: 'Debit', datafield: 'opening_balance', cellsformat: 'f2', cellsalign: 'right', width: '45%' } ], ready: function () { var amount_aggregates = $("#ob_debit_grid").jqxGrid('getcolumnaggregateddata', 'opening_balance', ['sum']); $('#debit_total_amount').val(amount_aggregates.sum.toFixed(2)); } });//To delete $("#ob_debit_deleterow").bind('click', function () { var selectedrowindex = $("#ob_debit_grid").jqxGrid('getselectedrowindex'); var rowscount = $("#ob_debit_grid").jqxGrid('getdatainformation').rowscount; if (rowscount > 1) { if (selectedrowindex >= 0 && selectedrowindex < rowscount) { var id = $("#ob_debit_grid").jqxGrid('getrowid', selectedrowindex); var commit = $("#ob_debit_grid").jqxGrid('deleterow', id); var amount_aggregates = $("#ob_debit_grid").jqxGrid('getcolumnaggregateddata', 'opening_balance', ['sum']); $('#debit_total_amount').val(amount_aggregates.sum.toFixed(2)); } } });
Please guide me regarding this.
Thanks & Regards,
ApekshaJuly 16, 2013 at 5:37 am in reply to: How to implement select all checkbox column in a grid with filter ? How to implement select all checkbox column in a grid with filter ? #25217Hi Peter,
Can’t fount “getrowdisplayindex” method on your website documentation in Grid’s API.
Regrads,
ApekshaJuly 16, 2013 at 5:08 am in reply to: How to implement select all checkbox column in a grid with filter ? How to implement select all checkbox column in a grid with filter ? #25215Hi Peter Stoev,
Can we get the rowindex if we have the getrowboundindex for a particular grid row.
If yes then please tell me how?Thanks & Regards,
ApekshaJuly 15, 2013 at 11:04 am in reply to: How to implement select all checkbox column in a grid with filter ? How to implement select all checkbox column in a grid with filter ? #25171Hi Peter Stoev,
Please have a look to my code can you tell me how I can use filter with this :-
var draft_initGrid = function () { gridid = "#draft_invoicetable";//update gridid... //console.log("gridid in draft_initGrid",gridid); //var url = "sampledata/invoice_maindata.php"; var source = { localdata: draft_invoice_data, datatype: "json", datafields: [ { name: 'item', type: 'bool' }, { name: 'id', type: 'number' }, { name: 'number', type: 'string' }, { name: 'reference', type: 'string' }, { name: 'contact_name', type: 'string' }, { name: 'contact_id', type: 'number' }, { name: 'date', type: 'string' }, { name: 'due_date', type: 'string' }, //{ name: 'paid', type: 'float' }, { name: 'due', type: 'float' }, { name: 'workflow_status_id', type: 'number' }, { name: 'workflow_status_status', type: 'string' }, { name: 'transaction_type_id', type: 'number' }, ], // id: 'id', // url: url, // root: 'data' }; var dataAdapter = new $.jqx.dataAdapter(source, { async: false, loadError: function (xhr, status, error) { alert('Error loading "' + source.url + '" : ' + error); } }); var columnCheckBox = null; var updatingCheckState = false; // initialize jqxGrid $("#draft_invoicetable").jqxGrid( { width: '97.7%', autoheight:true, source: dataAdapter, //sortable: true, enabletooltips: true, altrows: true, pageable: true, pagesizeoptions: ['10', '20','30','40','50'], editable:true, selectionmode: 'none', theme: 'metro', columns: [ { text: '', columntype: 'checkbox', datafield: 'item', width: '8%', renderer: function () { return '<div style="float:left;margin-left: 33.5%; margin-top: 5px;"></div>';/*CHANGES DONE ON 27 Feb*/ }, rendered: function (element) { $(element).jqxCheckBox({ theme: 'metro', width: 16, height: 16, animationShowDelay: 0, animationHideDelay: 0 }); columnCheckBox = $(element); $(element).on('change', function (event) { console.log("event :",event); var paginginformation = $("#draft_invoicetable").jqxGrid('getpaginginformation'); var pagenum = paginginformation.pagenum; var pagesize = paginginformation.pagesize; var pagescount = paginginformation.pagescount; var k = 1; var pageArray = new Array(); for (var i = pagenum * pagesize; i < (pagenum + 1) * pagesize; i++) { pageArray.push(i); }; var checked = event.args.checked; if (checked == null || updatingCheckState) return; var rowscount = $("#draft_invoicetable").jqxGrid('getdatainformation').rowscount; $("#draft_invoicetable").jqxGrid('beginupdate'); if (checked) { $("#draft_invoicetable").jqxGrid({ selectedrowindexes: pageArray }); for (m = pagenum * pagesize; m < (pagenum + 1) * pagesize; m++) { // Get the Check box value of all rows on the page var value = $('#draft_invoicetable').jqxGrid('getcellvalue', m, "item"); if (value != null){ $("#draft_invoicetable").jqxGrid('setcellvalue', m, 'item', event.args.checked); k = k * 1; } else { k = k * 0; break; }; }; if (0 ==(m % pagesize)) x = pagesize; else x = m % pagesize; }// END OF if (checked) else if (checked == false) { $("#draft_invoicetable").jqxGrid('clearselection'); for (var j = (pagenum) * pagesize; j < (pagenum + 1) * pagesize; j++) { $("#draft_invoicetable").jqxGrid('setcellvalue', j, 'item', event.args.checked); } x=0; } $("div#draftitem_label label").text(x); $("#draft_invoicetable").jqxGrid('endupdate'); }); } }, { text: 'Id',datafield: 'id', width: '12%',editable:false, hidden:true }, { text: 'Number',datafield: 'number', editable:false,width: '12%' }, { text: 'Ref',datafield: 'reference',editable:false,width: '12%' }, { text: 'To_id',datafield: 'contact_id',editable:false,width: '12%', hidden:true }, { text: 'To',datafield: 'contact_name',editable:false,width: '12%' }, { text: 'Date',datafield: 'date',editable:false, width: '15%' }, { text: 'Due Date',datafield: 'due_date',editable:false,width: '15%' }, // { text: 'Paid',datafield: 'paid', width: '8%' }, { text: 'Due',datafield: 'due',editable:false,width: '8%' }, { text: 'Status_id',datafield: 'workflow_status_id',editable:false, width: '18%', hidden:true }, { text: 'Status',datafield: 'workflow_status_status',editable:false, width: '18%' }, { text: 'transaction Type',datafield: 'transaction_type_id',editable:false, width: '18%', hidden:true } ] }); //START :Code to refresh the grid row selection on changing page or pagesize.Added by UI $("#draft_invoicetable").on("pagechanged", function (event) { //var args = event.args; //var pagenum = args.pagenum; //var pagesize = args.pagesize; $('#draft_invoicetable').jqxGrid('updatebounddata'); $("#draft_invoicetable").jqxGrid('clearselection'); $("div#draftitem_label label").text(0); }); $("#draft_invoicetable").on("pagesizechanged", function (event) { //var args = event.args; //var pagenum = args.pagenum; //var oldpagesize = args.oldpagesize; //var pagesize = args.pagesize; $("#draft_invoicetable").jqxGrid('updatebounddata'); $("#draft_invoicetable").jqxGrid('clearselection'); $("div#draftitem_label label").text(0); }); //END :Code to refresh the grid row selection on changing page or pagesize.Added by UI // select or unselect rows when the checkbox is checked or unchecked. $("#draft_invoicetable").bind('cellendedit', function (event) { if (event.args.value) { $("#draft_invoicetable").jqxGrid('selectrow', event.args.rowindex); ++x; $("div#draftitem_label label").text(x); } else { $("#draft_invoicetable").jqxGrid('unselectrow', event.args.rowindex); --x; $("div#draftitem_label label").text(x); //main checkbox set false if(x==0) { columnCheckBox.jqxCheckBox({ checked: false }); } } });
Thanks & Regards,
ApekshaJuly 5, 2013 at 9:18 am in reply to: How to create jqxwindow every time I open it on a click event. How to create jqxwindow every time I open it on a click event. #24580Hi Mariya,
Can you provide me an example that recreate jqxWindow afterwards.
Thanks & Regards,
ApekshaJune 29, 2013 at 6:01 am in reply to: How to set a grid column format to 0.00 How to set a grid column format to 0.00 #24163Hi Mariya,
Thanks for your reply it resolved my issue .
I also need to know is it possible to have the same format for a jqxinput field value.Regards,
ApekshaJune 29, 2013 at 5:50 am in reply to: How to get the value of datepicker in a particular format. How to get the value of datepicker in a particular format. #24162Hi Mariya,
I won’t be able to upgrade the version ,but found a solution to format the date.
Adding my code below it solved my problem.$("#date").jqxDateTimeInput({formatString: "yyyy-MM-dd",width:110,height:'18px', animationType: 'fade', dropDownHorizontalAlignment: 'right', theme: 'ui-start' }); var jdate=$("#date").jqxDateTimeInput('getDate');function convert(jdate){ var date = new Date(jdate), mnth = ("0" + (date.getMonth()+1)).slice(-2), day = ("0" + date.getDate()).slice(-2); return [ date.getFullYear(), mnth, day ].join("-");}var journaldate= convert(jdate);$('#journal_date').val(journaldate);
Thanks & Regards,
ApekshaJune 28, 2013 at 12:42 pm in reply to: How to get the value of datepicker in a particular format. How to get the value of datepicker in a particular format. #24114Hi Mariya,
I am using jquery-1.8.2.min.js and jQWidgets v2.6.1 Release for my project.
Thanks & Regards,
ApekshaJune 28, 2013 at 9:13 am in reply to: How to get the value of datepicker in a particular format. How to get the value of datepicker in a particular format. #24085Hi Mariya,
I have tried this in my code but I am not getting the exact format that I want.
I have tried some more methods whose output is given below :-var jdate1=$(‘#date’).jqxDateTimeInput(‘val’);
Output – date1 is undefinedvar jdate2=$(‘#date’).jqxDateTimeInput(‘val’, ‘date’);
Output – date2 is undefinedvar jdate3=$(‘#date’).val();
Output – date3 isvar jdate4=$(‘#date’).val(‘date’);
Output – date4 is [div#date.fields jqx-widget jqx-widget-ui-start, context: document, selector: “#date”, jquery: “1.9.1”, constructor: function, init: function…]var jdate5=$(‘#date’).jqxDateTimeInput(‘getDate’);
Output – date5 is Fri Jun 28 2013 00:00:00 GMT+0530 (India Standard Time)Can you please guide me regarding this as I exactly want output in this format (yy-mm-dd).
Thanks & Regards,
ApekshaJune 28, 2013 at 7:21 am in reply to: How to implement single search for all the columns of grid. How to implement single search for all the columns of grid. #24069Hi Peter Stoev,
I am facing an issue that is I have a select all checkbox in my grid that select all the row and also checked the comboboxes of each row.
While using filter it is affecting my select all code as I am selecting rows by using row index.
And also I tried to use getrowboundindex but it is not working.I am adding my code below please let me know :-
var draft_initGrid = function () { gridid = "#draft_invoicetable";//update gridid... //console.log("gridid in draft_initGrid",gridid); //var url = "sampledata/invoice_maindata.php"; var source = { localdata: draft_invoice_data, datatype: "json", datafields: [ { name: 'item', type: 'bool' }, { name: 'id', type: 'number' }, { name: 'number', type: 'string' }, { name: 'reference', type: 'string' }, { name: 'contact_name', type: 'string' }, { name: 'contact_id', type: 'number' }, { name: 'date', type: 'string' }, { name: 'due_date', type: 'string' }, //{ name: 'paid', type: 'float' }, { name: 'due', type: 'float' }, { name: 'workflow_status_id', type: 'number' }, { name: 'workflow_status_status', type: 'string' }, { name: 'transaction_type_id', type: 'number' }, ], // id: 'id', // url: url, // root: 'data' }; var dataAdapter = new $.jqx.dataAdapter(source, { async: false, loadError: function (xhr, status, error) { alert('Error loading "' + source.url + '" : ' + error); } }); var columnCheckBox = null; var updatingCheckState = false; // initialize jqxGrid $("#draft_invoicetable").jqxGrid( { width: '97.7%', autoheight:true, source: dataAdapter, //sortable: true, enabletooltips: true, altrows: true, pageable: true, pagesizeoptions: ['10', '20','30','40','50'], editable:true, selectionmode: 'none', theme: 'metro', columns: [ { text: '', columntype: 'checkbox', datafield: 'item', width: '8%', renderer: function () { return '<div style="float:left;margin-left: 33.5%; margin-top: 5px;"></div>';/*CHANGES DONE ON 27 Feb*/ }, rendered: function (element) { $(element).jqxCheckBox({ theme: 'metro', width: 16, height: 16, animationShowDelay: 0, animationHideDelay: 0 }); columnCheckBox = $(element); $(element).on('change', function (event) { console.log("event :",event); var paginginformation = $("#draft_invoicetable").jqxGrid('getpaginginformation'); var pagenum = paginginformation.pagenum; var pagesize = paginginformation.pagesize; var pagescount = paginginformation.pagescount; var k = 1; var pageArray = new Array(); for (var i = pagenum * pagesize; i < (pagenum + 1) * pagesize; i++) { pageArray.push(i); }; var checked = event.args.checked; if (checked == null || updatingCheckState) return; var rowscount = $("#draft_invoicetable").jqxGrid('getdatainformation').rowscount; $("#draft_invoicetable").jqxGrid('beginupdate'); if (checked) { $("#draft_invoicetable").jqxGrid({ selectedrowindexes: pageArray }); for (m = pagenum * pagesize; m < (pagenum + 1) * pagesize; m++) { // Get the Check box value of all rows on the page var value = $('#draft_invoicetable').jqxGrid('getcellvalue', m, "item"); if (value != null){ $("#draft_invoicetable").jqxGrid('setcellvalue', m, 'item', event.args.checked); k = k * 1; } else { k = k * 0; break; }; }; if (0 ==(m % pagesize)) x = pagesize; else x = m % pagesize; }// END OF if (checked) else if (checked == false) { $("#draft_invoicetable").jqxGrid('clearselection'); for (var j = (pagenum) * pagesize; j < (pagenum + 1) * pagesize; j++) { $("#draft_invoicetable").jqxGrid('setcellvalue', j, 'item', event.args.checked); } x=0; } $("div#draftitem_label label").text(x); $("#draft_invoicetable").jqxGrid('endupdate'); }); } }, { text: 'Id',datafield: 'id', width: '12%',editable:false, hidden:true }, { text: 'Number',datafield: 'number', editable:false,width: '12%' }, { text: 'Ref',datafield: 'reference',editable:false,width: '12%' }, { text: 'To_id',datafield: 'contact_id',editable:false,width: '12%', hidden:true }, { text: 'To',datafield: 'contact_name',editable:false,width: '12%' }, { text: 'Date',datafield: 'date',editable:false, width: '15%' }, { text: 'Due Date',datafield: 'due_date',editable:false,width: '15%' }, // { text: 'Paid',datafield: 'paid', width: '8%' }, { text: 'Due',datafield: 'due',editable:false,width: '8%' }, { text: 'Status_id',datafield: 'workflow_status_id',editable:false, width: '18%', hidden:true }, { text: 'Status',datafield: 'workflow_status_status',editable:false, width: '18%' }, { text: 'transaction Type',datafield: 'transaction_type_id',editable:false, width: '18%', hidden:true } ] }); //START :Code to refresh the grid row selection on changing page or pagesize.Added by UI $("#draft_invoicetable").on("pagechanged", function (event) { //var args = event.args; //var pagenum = args.pagenum; //var pagesize = args.pagesize; $('#draft_invoicetable').jqxGrid('updatebounddata'); $("#draft_invoicetable").jqxGrid('clearselection'); $("div#draftitem_label label").text(0); }); $("#draft_invoicetable").on("pagesizechanged", function (event) { //var args = event.args; //var pagenum = args.pagenum; //var oldpagesize = args.oldpagesize; //var pagesize = args.pagesize; $("#draft_invoicetable").jqxGrid('updatebounddata'); $("#draft_invoicetable").jqxGrid('clearselection'); $("div#draftitem_label label").text(0); }); //END :Code to refresh the grid row selection on changing page or pagesize.Added by UI // select or unselect rows when the checkbox is checked or unchecked. $("#draft_invoicetable").bind('cellendedit', function (event) { if (event.args.value) { $("#draft_invoicetable").jqxGrid('selectrow', event.args.rowindex); ++x; $("div#draftitem_label label").text(x); } else { $("#draft_invoicetable").jqxGrid('unselectrow', event.args.rowindex); --x; $("div#draftitem_label label").text(x); //main checkbox set false if(x==0) { columnCheckBox.jqxCheckBox({ checked: false }); } } });
Please tell me how I can use filter so that it won’t disturb my this code.
Thanks & Regards,
ApekshaJune 27, 2013 at 2:28 pm in reply to: How to implement single search for all the columns of grid. How to implement single search for all the columns of grid. #24028Hi Peter Stoev,
Thanks for your quick reply I will implement filter and let you know if I want any guidance regarding this.
Thanks & Regards,
Apeksha -
AuthorPosts