jQWidgets Forums
Forum Replies Created
-
Author
-
The answer always easy when you know it.
Thanks a bunch peter.
btw i feel pretty stupid now that i know it’s so easy
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>Manufactures</title> <link rel="stylesheet" href="jqcore/css/ui-lightness/jquery-ui-1.8.21.custom.css" type="text/css" /> <link rel="stylesheet" href="jqwidgets/jqwidgets/styles/jqx.base.css" type="text/css" /> <link rel="stylesheet" href="jqwidgets/jqwidgets/styles/jqx.classic.css" type="text/css" /> <link rel="stylesheet" href="styles/main.css" type="text/css" /> <link rel="stylesheet" href="styles/form.css" type="text/css" /> <script type="text/javascript" src="javascript/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="jqcore/js/jquery-ui-1.8.21.custom.min.js"></script> <script type="text/javascript" src="jqwidgets/scripts/gettheme.js"></script> <script type="text/javascript" src="jqwidgets/jqwidgets/jqx-all.js"></script> <script> $(document).ready(function () { var theme = 'classic'; $('#manu').jqxValidator({ rules: [ { input: '#ainput', message: 'Verplicht veld', action: 'keyup', rule: 'minLength=3' }, ], theme: theme }); }); </script></head><body> <div id="manufacturer" style="padding:15px;"> <form id="manu"> <table> <tr> <td class="label" >Fabrikant code:</td> <td><input id="ainput" class="text-input-small" /></td> </tr> </table> </form> </div></body></html>
Is there any documentation on how to post code on the forum?
$(document).ready(function () {
var theme = 'classic';
$('#manu').jqxValidator({
rules: [
{ input: '#userInput', message: 'Verplicht veld', action: 'keyup', rule: 'minLength=3' },
],
theme: theme
});});
I’ll try to post the code. But posting code on this forum is a annoying job.
Just tryed this and got the same error:
$(document).ready(function () {
$(‘#manu’).jqxValidator({
rules: [
{ input: ‘#userInput’, message: ‘Username is required!’, action: ‘keyup, blur’, rule: ‘required’ }],
theme: theme
});
});Naam:
It was just the selector saying to grab only #m__name within #manufacturer
But i have just renamed the fields and still getting this error:
Uncaught TypeError: Cannot call method ‘toLowerCase’ of undefined
within the Validator function
Cheers Peter,
Exactly what i was looking for
Cheers Peter, i’ll update the source
In the end it was a easy fix
add this:
$(“#jqxgrid”).bind(“sort”, function (event) {
var sortinformation = event.args.sortinformation;
sortinformation.sortcolumn = sortinformation.sortcolumn;
$(‘#jqxgrid’).jqxGrid(‘updatebounddata’);
});to set the sortinformation to the current sort column
then in rendergridrows you can call sortinformation with current selected column name
var rendergridrows = function (params) {
var sortinformation = $(“#jqxgrid”).jqxGrid(“getsortinformation”);
var sortcolumn = sortinformation.sortcolumn;
var sortdirection = sortinformation.sortdirection;
if(typeof sortdirection!=’undefined’ && typeof sortcolumn!=’undefined’){
sortdirection = sortinformation.sortdirection.ascending ? “ascending” : “descending”;
sortcolumn = sortinformation.sortcolumn;
}else{
sortdirection = false;
sortcolumn = false;
}
var griddata = getjqdata(“ajax/table.php”,params.startindex, params.endindex,getsearchparams(),sortcolumn,sortdirection );return griddata[‘data’];
}Thanks peter for your prompt response
I was aware of this feature but cannot use it because i am returning more data than just grid data.
i need full control of the response
the response configures these jqwidgets params:
$(“#jqxgrid”).jqxGrid(settings);
$(“#jqxgrid”).jqxGrid({rendergridrows: rendergridrows});
$(“#jqxgrid”).jqxGrid(‘source’, source );
$(“#jqxgrid”).jqxGrid(‘columns’, columns);and about 10 other things in the page. That was why i couldn’t do it this way.
i use this method:
function getjq(url,getparams){
var result;
$.ajax({
type: “GET”,
url: url,
data: getparams,
dataType: “json”,
async: false,
success: function(data) {
result = data;
}
});
return result;
}cheers peter.
I got the function to work before but it was 1 step behind the current action
var rendergridrows = function (params) {
var sortinformation = $(‘#grid’).jqxGrid(‘getsortinformation’);
var sortcolumn = sortinformation.sortcolumn;
var sortdirection = sortinformation.sortdirection;var griddata = getjqdata(params.startindex, params.endindex,sortcolumn,sortdirection );
return griddata[‘data’];}
getsortinformation
show’s me the current position. I could not get a event handler to work within rendergridrowsThis is the last piece of the puzzle i need to figure out to complete the program.
if you could help me out i would be very great full.
=> jquery-grid-extra-http-variables.htm.
i couldn’t use this because there’s much more going on in the page and all info is linked to the json. That’s why i had to use my own call function to the data .Problem solved:
$(“#jqxgrid”).jqxGrid({rendergridrows: rendergridrows});
Sorry. It’s pretty clear where to find this.
grid => API => Behavior => columns
-
AuthorPosts