jQWidgets Forums
Forum Replies Created
-
Author
-
Nvm, fixed it.
Or maybe: Ol search, change the url, reload the grid data. Getting the input from the searchfield.
So, basically, can you take the input fields, send them to get URL that gets the data and then reload the grid with the data returned?
Nvm, I’ve fixed it.
Thanks for the help Dimitar!
Hm, yes, it’s starting to work, almost at least. Still having some difficulty with the getting of the data. The grid loads without any data. But as soon as i filled in something to search for, the grid gets filled with all the data, not only the data that i searched for.
Almost yeah, its a great start. However the grid is already loaded with the data when you get to the page. It should be empty and just get the data similar to the search in the input field. This should be possible to do somehow though, right?
September 16, 2015 at 12:30 pm in reply to: change editable dynamically change editable dynamically #75912Got it, thanks for the help, you guys are awesome!
September 16, 2015 at 9:48 am in reply to: change editable dynamically change editable dynamically #75898I am using the “setcolumnproperty”. The question is where i should use the if statement containing it.
September 16, 2015 at 9:36 am in reply to: change editable dynamically change editable dynamically #75894Im looking for a way to run the
var loggedInUser = document.getElementById("loggedInUser").innerHTML; if(loggedInUser == "ME"){ $('#jqxgrid').jqxGrid('setcolumnproperty', 'Comment', 'editable', true); }
when the grid is loaded. So i can change the comments editable value depending on which user is logged in on the site.
Is there a way to do this with anything in your api?September 16, 2015 at 9:00 am in reply to: change editable dynamically change editable dynamically #75891Ive tried yo use
gridComplete: function () { var loggedInUser = document.getElementById("loggedInUser").innerHTML; if(loggedInUser == "ME"){ $('#jqxgrid').jqxGrid('setcolumnproperty', 'Comment', 'editable', true); } },
But it didnt work for some reason, but gave me:
uncaught exception: jqxCore: invalid property ‘gridComplete’
Never mind. Ive solved it!
Is it enough to see the problem?
Ive got some sensitive code that i really cant shear for all to see.
however, i can give this to you, it should be enough.$('#jqxGrid').on('rowexpand', function (event) { var args = event.args; var details = args.details; selectedRowIndex = args.rowindex; var boundIndex = $('#jqxGrid').jqxGrid('getrowboundindex', selectedRowIndex); var val = $('#jqxGrid').jqxGrid('getcellvalue', boundIndex, "Id"); var vall = $('#jqxGrid').jqxGrid('getcellvalue', boundIndex, "UserName"); var rows = $('#jqxGrid').jqxGrid('getrows'); var id = 'yourIframe_'+val; var usertest = document.getElementById("loggedInUser").innerHTML; window.setTimeout( function(){ alert ("Username: "+vall+" id: "+val); }, 10); });
This works no matter if the grid got a filter and i search on it and select an user wile it filtered for exemple: “Pizzas”. Its awesome.
$("#jqxGrid").on('cellendedit', function (event) { // event arguments. var args = event.args; // column data field. var dataField = event.args.datafield; // row's bound index. var rowBoundIndex = event.args.rowindex; // cell value var value = args.value; // cell old value. var oldvalue = args.oldvalue; // row's data. var rowData = args.row; var args = event.args; var details = args.details; selectedRowIndex = args.rowindex; var boundIndex = $('#jqxGrid').jqxGrid('getrowboundindex', selectedRowIndex); var val = $('#jqxGrid').jqxGrid('getcellvalue', boundIndex, "Id"); var vall = $('#jqxGrid').jqxGrid('getcellvalue', boundIndex, "UserName"); alert ("Username: "+vall+" id: "+val); } });
This code however, dosn’t. It dosn’t take to account that the grid is filtered. And therefore, when i do a cell edit in the start, it might show the username and id for the user 4 rows down or so. And if i filter again for “pizzas”, it only gives me null as values.
So, basically on the rowexpand, it works perfectly. On cellendedit or any other event, it dosn’t work for me!
I’m sorry for my lack of english, its not my native language. And cheers for all the help, you guys are awesome.
September 9, 2015 at 7:40 am in reply to: Keep old value inside cell Keep old value inside cell #75686Tried it, when i use
if (confirm('are you sure that you want to change the old value "'+oldvalue+'" to "'+value+'"?')) { Change value.... } else { $("#jqxgrid").jqxGrid('setcellvalue', 0, "Comment", "test"); }
And click “cancel” it gets stuck in a loop kinda.
-
AuthorPosts