jQWidgets Forums
Forum Replies Created
-
Author
-
Thank you for your response. I’ve tried adding the css :
<style> .jqx-widget-content { color: red; } </style>
It changes the font ‘within’ the jqwidgets field, but when I populate the options from the autocomplete, the options still in blue color. What I want to achieve is to set the color of the fonts in the options to black. Any other way to achieve that ? Thank you.
July 4, 2014 at 8:10 am in reply to: cellendedit event error when 2 grid on the same page cellendedit event error when 2 grid on the same page #56775I found the reason. It is due to the same variable name that I use to identify the grid, both uses var grid, so it conflicts when I call the others. This is not jqwidgets but my mistake. Tq
July 4, 2014 at 7:39 am in reply to: cellendedit event error when 2 grid on the same page cellendedit event error when 2 grid on the same page #56773This is how I initialize the grid :
if(options.filterable) { data.filter = function() { $("#'.$this->selector.'").jqxGrid("updatebounddata", "filter"); } } if(options.sortable) { data.sort = function() { $("#'.$this->selector.'").jqxGrid("updatebounddata", "sort"); } } if(typeof data.beforeprocessing == "undefined") { data.beforeprocessing = function(record) { if(record) data.totalrecords = record.totalRows; } } if(typeof data.root == "undefined") { data.root = "rows"; } if(typeof data.cache == "undefined") { data.cache = false; } if(typeof data.addrow == "undefined") { data.addrow = function (rowid, rowdata, position, commit) { // synchronize with the server - send insert command // call commit with parameter true if the synchronization with the server is successful //and with parameter false if the synchronization failed. // you can pass additional argument to the commit callback which represents the new ID if it is generated from a DB. commit(true); }; } if(typeof data.updaterow == "undefined") { data.updaterow = function (rowid, newdata, commit) { // synchronize with the server - send insert command // call commit with parameter true if the synchronization with the server is successful //and with parameter false if the synchronization failed. // you can pass additional argument to the commit callback which represents the new ID if it is generated from a DB. commit(true); }; } if(typeof data.deleterow == "undefined") { data.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); }; } options.source = new $.jqx.dataAdapter(data, { loadError: function(xhr, status, error) { console.log("Error : " + error); } }); $("#'.$this->selector.'").jqxGrid(options);
Okay, tq for the support.
Thank you for the reply. Is there any solution on how I could hide the button ? Based on my code above, my code will check if the row’s ID is allowed to be accessed and if not, then hide button. Please help, tq
I think I figure out why it shows error “too much recursion”. When I setcellvalue, it will trigger the function cellsrenderer again, right ? Is there a way that I could set the cell value to null or empty without triggering the cellsrenderer ? Please help, tq
This is what I’ve come up with so far. I use ‘cellsrenderer’ like this :
function (rowIndex, dataField, value, defaultHtml) { var rowData = $("#jqxgrid").jqxGrid("getrowdata", rowIndex); var isAccessable = false; // I've defined accessableIds before for(var prop in accessableIds) { if(accessableIds.hasOwnProperty(prop)) { if(accessableIds[prop] === rowData.id) isAccessable = true; } } if(isAccessable) return "View"; else $("#jqxgrid").jqxGrid("setcellvalue", rowIndex, dataField, "No Value"); }
But it shows error in console : “too much recursion”.
Am I missing anything ? Please help, tq
I am sorry, I cannot show you my code because my code is not written in javascript, I have written a Yii Framework extension for JqWidgets and therefore my code is PHP, meaning I pass the params, functions, etc in PHP. I also use full AJAX and therefore I cannot do “right click view page source” and show you the generated source code.
Have you take a look at this example ? Pop Up Dialog
If you see the source code on line 115, there is a line :
$("#Save").click(function () { ...
Now if you want to refresh the grid when the user press the save button, then you could just add :
$("#Save").click(function () { ... $("#jqxGrid").jqxGrid("updatebounddata"); ...
Or if you want to refresh the grid on window close then you could just add :
$('#jqxWindow').on('close', function (event) { $("#jqxGrid").jqxGrid("updatebounddata"); });
Hope that helps
Okay. Thank you Dimitar for the answer.
But can I retrieve the generated ID ? On buttonclick I call :alert($(this).attr("id"));
But it shows empty string. If I cannot set the ID before hand, perhaps I could set the ID after it is generated ?
Hello. I am using pop up to input data to the grid also and I bind the event on windows closed and refresh the grid using :
... $("#jqxGrid").jqxGrid("updatebounddata"); ...
November 22, 2013 at 8:37 am in reply to: Submit Grid Data On Form Submit Submit Grid Data On Form Submit #33129Sorry, forgot 1 thing. And I also need the user to be able to change the grid column value, so that in controller I could save the value input by the users. How can I do that ? Please help, thank you
November 15, 2013 at 10:05 am in reply to: getrowdata of hidden column getrowdata of hidden column #32699Thank you for the fast response. Nope, it has its value. I found the problem, it was my mistake, I did not assign the value, because I use method “addrow” for the grid rows, and did not set the delivery_confirmation_id. Thanks once again
October 10, 2013 at 1:47 pm in reply to: Set Selected Without Knowing The Index Set Selected Without Knowing The Index #30562Thank you Mariya, that’s exactly what I needed
September 13, 2013 at 3:46 pm in reply to: Usage of selectionmode as checkbox Usage of selectionmode as checkbox #28962Hello. I’ve got the solution of how to retrieve the id of the selected row. But now how to set the row as selected when I load the box data ? “selectrow” would not be appropriate since I do not know the index of the row, nor how to pass the id of the saved row to set the row as checked on page load. Please help. Thank you
September 13, 2013 at 1:50 pm in reply to: Usage of selectionmode as checkbox Usage of selectionmode as checkbox #28954OMG, you are right. I checked the “view page source” on my chrome and the file is still pointing to the old file.
I cleared the cache and it works well. Thank youBut I haven’t got solution of how to retrieve the id of the selected row. I found method ‘.on(“rowselect”)’ :
$("#gridId").on("rowselect", function(e){ alert(e.args.rowindex);});
But it only retrieve the index of the row which is not what I need. Could you please tell me how to retrieve the id ? Thank you
-
AuthorPosts