jQWidgets Forums
Forum Replies Created
-
Author
-
Thanks
Any help with this?
It would be good to get this sorted please or should I raise it as one of my technical support tickets?
I’m sorry to be so thick but I’m still struggling. I have managed to get something returned but it’s still not right. The returned data does not seem to have anything to do with the selected data and does not vary whether you choose one row or many:-
Thanks for your continued support, sorry this is proving such a sticking point for me. I’ve run the code and I see that it is basically the code I have played with before. In the original example above I was using local data rather then MySQL data purely for convenience. What I still can’t get is how to capture the section made on the grid when a form is returned. This brings me back to the original link I offered:-
From your earlier post I think I can see I need to use:-
formatdata: function (data) {
return “my data”;
}And you mention:
$(‘#jqxgrid’).jqxGrid(‘getselectedrowindex’);
However I’m completely at a loss as to how to do this. Nothing I try works.
With reference to the link you gave me:-
php-server-side-grid-filtering.htm
If I amend the HTML so (see here for full code):-
<form action="" method="POST" id="TestForm" name="TestForm"> <div id='jqxWidget'> <div id="jqxgrid"></div> </div> <p style="clear: both;"> </p> <input type="submit" name="GoButton" id="GoButton" value="Post"></form>
how do I need to change the JavaScript in order for the post to capture the selected ID on the grid?
I’m checking this out now. FYI there are two typos (three if you count the two occurrences of “orders”:-
in your northwind DB the table is Orders not orders and there’s an extra ” in the
tag. I’ll let you know how I get on.Thanks for the speedy response. I’m afraid I’m struggling here, sorry.
Taking the code on the grid tutorial at http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-getting-started.htm:-
var source =
{
localdata: data,
datatype: “array”
};
var dataAdapter = new $.jqx.dataAdapter(source, {
loadComplete: function (data) { },
loadError: function (xhr, status, error) { }
});
$(“#jqxgrid”).jqxGrid(
{
source: dataAdapter,
columns: [
{ text: ‘First Name’, datafield: ‘firstname’, width: 100 },
{ text: ‘Last Name’, datafield: ‘lastname’, width: 100 },
{ text: ‘Product’, datafield: ‘productname’, width: 180 },
{ text: ‘Quantity’, datafield: ‘quantity’, width: 80, cellsalign: ‘right’ },
{ text: ‘Unit Price’, datafield: ‘price’, width: 90, cellsalign: ‘right’, cellsformat: ‘c2’ },
{ text: ‘Total’, datafield: ‘total’, width: 100, cellsalign: ‘right’, cellsformat: ‘c2’ }
]
});I can see I need somehow to include:-
formatdata: function (data) {
return “my data”;
}And you mention:
$(‘#jqxgrid’).jqxGrid(‘getselectedrowindex’);
However I’m completely at a loss to make this work.
OK Classic newbie error. Neglected to copy the scripts folder to the test system. Thanks for the help.
Hmm am using a web server and have indeed studied the server side code (connect.php and data.php would have worked other wise :>)). However the Ajax issue is new to me so therein lies the problem perhaps. As I said I’m a real newbie to JavaScript.
-
AuthorPosts