Forum Replies Created
-
Author
-
December 4, 2019 at 6:09 pm in reply to: Updatebounddata does not work Updatebounddata does not work #107500
Hi Hristo.
I don’t have any console errors when running updatebounddata.
What I have seen in your example and in the documentation for this to work are these two lines.
source.localdata = generatedata(10); $("#jqxgrid").jqxGrid("updatebounddata", "cells");
In your example, commenting on this line and executing it does not update the data.
//** source.localdata = generatedata(10); // commented line $("#jqxgrid").jqxGrid("updatebounddata", "cells");
In my case I only put this line that is why it does not work.
$("#gvData").jqxGrid("updatebounddata", "cells");
This is my complete code, I work with dynamic columns and step parameters. As I mentioned above when using the function to update my grid it is not updated, I still see the same status after inserting. I can see the new status only if I refresh the page and check the data again.
Can you tell me how I can use your function to update the grid?
Thank you very much.
function get_information() { var person = $("[id*=ddlPerson]").val(); //dropdownlist person var Branch = ""; if (persona != 0) { var values; var datafields = new Array(); var columns = new Array(); var columnsArray = []; $.ajax({ type: "POST", dataType: "json", url: "frmPerson.aspx/Information_person", contentType: "application/json; charset=utf-8", data: '{id_person:"' + person + '",Sucursal:"' + Branch + '"}', async: false, success: function(data) { if (data != '') { values = JSON.parse(values[0]); /************************************** This is my dinamyc columns ***********************************************************/ for (var i in values[0]) { datafields.push({ name: i, type: 'string' }); columns.push({ text: i, datafield: i, filtercondition: 'CONTAINS', align: 'center', minwidth: 100 }); } for (var j = 1; j < columns.length; j++) { columnsArray.push(columns[j]); } /**********************************************************************************************************************************/ } var gridSource = { datatype: "json", datafields: datafields, localdata: values, async: false }; var gridDataAdapter = new $.jqx.dataAdapter(gridSource); var editrow = -1; columnsArray.push({ text: 'Add', datafield: 'Edit', filtercondition: 'CONTAINS', align: 'center', minwidth: 100, columntype: 'button', cellclassname: "color_especial", cellsrenderer: function() { }, buttonclick: function(row) { editrow = row; /******************* Here I get the data I just put some data as an example ***************/ var datarecord = $("#gvData").jqxGrid('getrowdata', editrow); var person_name = $("#gvData").jqxGrid('getcolumnat', 1).datafield; var person_age = $("#gvData").jqxGrid('getcolumnat', 2).datafield; var payment1 = $("#gvData").jqxGrid('getcolumnat', 3).datafield; var payment2 = $("#gvData").jqxGrid('getcolumnat', 4).datafield; var payment3 = $("#gvData").jqxGrid('getcolumnat', 5).datafield; $("#txtName_Person").val(dataRecord[name_person]); $("#txtAge_Person").val(dataRecord[age_person]); $("#txtPayment1").val(dataRecord[payment1]); $("#txtPayment2").val(dataRecord[payment2]); $("#txtPayment3").val(dataRecord[payment3]); //Popup bootstrap display data in the input text. $("#Popup_AddData").modal('show'); } }); $("#gvData").jqxGrid({ source: gridDataAdapter, editable:false, width: '100%', columnsresize: true, autoheight: false, autorowheight: false, pageable: true, showfilterrow: true, filterable: true, handlekeyboardnavigation: function(event) { var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0; if (key == 13) { return true; } else if (key == 27) { return true; } }, columns: columnsArray }); //****** This is the button to add the data to the database this button is within the modal *********// $("#btnAcept").click(function() { $.ajax({ type: "POST", datatype: "json", url: "frmPerson.aspx/Payment_person", contentType: "application/json; charset=utf-8", data: '{person_name:"' + $("#txtName_Person").val() + '",person_age:"' + Number(("#txtAge_Person").val())+ '",payment1:"' + Number(("#txtPayment1").val()) + '",payment2:"' + Number(("#txtPayment2").val()) + '",payment3:"' + Number(("#txtPayment2").val()) + '"}', cache: false, success: function(data) { //******** here I update my grid but it doesn't update me ******// $('#gvData').jqxGrid('updatebounddata'); //$('#gvData').jqxGrid('updatebounddata', 'cells'); }, error: function(error) { alert(error.responseText); console.log(error.responseText); jsonValue = jQuery.parseJSON(Error.responseText); alert(error.respose.Text); alert("Error"); } }); }); }, error: function(error) { alert(error.responseText); console.log(error.responseText); jsonValue = jQuery.parseJSON(Error.responseText); alert(error.respose.Text); alert("Error"); } }); } }
- This reply was modified 3 years, 9 months ago by Novato. Reason: edit code
October 16, 2019 at 10:16 pm in reply to: How to display the text "No data to display" when the jqxgrid has no data? How to display the text "No data to display" when the jqxgrid has no data? #107023Hi admin,
Hi, can you give me an example with the code I published?
Thank you very much
September 13, 2019 at 4:11 pm in reply to: How to place row in button.click so that it works the same way as buttonclick: f How to place row in button.click so that it works the same way as buttonclick: f #106764Hi Hristo.
I am doing the following:
I have a main grid with its nested grid, the main grid has a column of buttons where by clicking I show information in a bootstrap modal.
My grid has a checkbox type column where when you check the checkbox the button disables to not show the information in the modal.
I am guided by this example:
My problem is the following:
When executing my code you have an error in this code:Code:
if (data.Aprobar) { $('button{rowId}').jqxButton({ disabled: true }); }
Error:
Uncaught Error: Syntax error, unrecognized expression: button{rowId} at Function.oe.error (jquery-3.3.1.min.js:2) at oe.tokenize (jquery-3.3.1.min.js:2) at oe.select (jquery-3.3.1.min.js:2) at Function.oe [as find] (jquery-3.3.1.min.js:2) at w.fn.init.find (jquery-3.3.1.min.js:2) at new w.fn.init (jquery-3.3.1.min.js:2) at w (jquery-3.3.1.min.js:2) at createwidget (ConsultaBI.js:1628) at c.<computed>._renderwidgetcell (jqxgrid.js:8) at _rendercell (jqxgrid.js:8)
Also use the code as in the example:
if (data.Aprobar) { $('.btn-${rowId}').jqxButton({ disabled: true }); }
Error:
Uncaught Error: Syntax error, unrecognized expression: .btn-${rowId} at Function.oe.error (jquery-3.3.1.min.js:2) at oe.tokenize (jquery-3.3.1.min.js:2) at oe.select (jquery-3.3.1.min.js:2) at Function.oe [as find] (jquery-3.3.1.min.js:2) at w.fn.init.find (jquery-3.3.1.min.js:2) at new w.fn.init (jquery-3.3.1.min.js:2) at w (jquery-3.3.1.min.js:2) at createwidget (ConsultaBI.js:1631) at c.<computed>._renderwidgetcell (jqxgrid.js:8) at _rendercell (jqxgrid.js:8)
I could solve it with the following code and add the cellbeginedit property to my column.
if (data.Aprobar) { $('button').jqxButton({ disabled: true }); }
My question is:
How to deactivate or activate the entire column of buttons when clicking a button that is outside the main grid?
September 10, 2019 at 9:25 pm in reply to: I can't get the data from the nested grid a second time I can't get the data from the nested grid a second time #106712Hi, thanks. I have been able to solve my problem.
September 10, 2019 at 9:18 pm in reply to: How to obtain the data of the nested grid when clicking on the edit button? How to obtain the data of the nested grid when clicking on the edit button? #106711Hi, thanks. I have been able to solve my problem.
September 10, 2019 at 9:17 pm in reply to: I can't get the data from the nested grid a second time I can't get the data from the nested grid a second time #106710Hi, thanks. I have been able to solve my problem.
September 10, 2019 at 3:25 pm in reply to: How to obtain the data of the nested grid when clicking on the edit button? How to obtain the data of the nested grid when clicking on the edit button? #106706Hi Todor.
This example works great for me but I have encountered a problem and that is that by filtering through the textbox using the showfilterrow property on my main grid I can no longer obtain the data as you mention me.
Any idea how to fix this?
Thank you.
August 21, 2019 at 2:56 pm in reply to: How to disable a button with checkbox column in jqxgrid How to disable a button with checkbox column in jqxgrid #106540Hi Todor.
Thanks for the example it worked perfectly.
August 16, 2019 at 2:57 pm in reply to: How to get the data from my nested grid by expanding a row of my jqxgrid using s How to get the data from my nested grid by expanding a row of my jqxgrid using s #106507Thanks, I was able to solve the problem.
August 14, 2019 at 4:58 pm in reply to: How to disable a button with checkbox column in jqxgrid How to disable a button with checkbox column in jqxgrid #106490Hi Todor.
Thanks for the example it worked for me but with the pointer-events property it doesn’t work with internet explorer 10 you know of another property with the same functionality as pointer-events.
I hope you can answer me soon and thank you very much.
July 24, 2019 at 4:17 pm in reply to: Error in jqxgrid when hiding columns Error in jqxgrid when hiding columns #106226Hi Todor
Thanks for your help this works well.
July 23, 2019 at 4:30 pm in reply to: How to get or send the id of the row every time I expand it? How to get or send the id of the row every time I expand it? #106191Hello
Thank you but I have already solved this problem.
July 23, 2019 at 2:28 pm in reply to: jqxgrid is enlarged when loaded in a boostrap modal jqxgrid is enlarged when loaded in a boostrap modal #106181Hi Hristo
I have managed to solve this, thank you very much for your help.
July 15, 2019 at 3:59 pm in reply to: How to show information in the jqxGrid twice? How to show information in the jqxGrid twice? #106077Hi, Todor.
Sorry to take a while to respond, display: none worked well for my needs.
July 10, 2019 at 12:03 pm in reply to: How to show information in the jqxGrid twice? How to show information in the jqxGrid twice? #106023Hi, Todor.
I destroyed the grid and showed the excel data in a new grid and it worked perfectly.
But after I need to load the data from my destroyed first grid again, the problem I notice is that the destroy method removes the element from the Dom.
Any suggestions to show the data again in the destroyed grid?
I would really appreciate it if you can answer me as quickly as possible thank you very much.
-
AuthorPosts