jQWidgets Forums
Forum Replies Created
-
Author
-
Ah. Ok. I see how the initialization of the source object goes hand in hand with the data.php file array initialization. What I ended up doing was to change the data.php file so that array initialization had the same name on both sides of the initialization. So the effect was the same.
$responses[] = array( 'action' => $row['action'], 'response_date' => $row['response_date'], 'response' => htmlspecialchars($row['response']) );
After I did this it started to show results. But, it’s nice to understand how the grid functions which you have definitely made clear in your example.
I have another question for you though and this ones an easy one.
Is there a way to limit the size of the grid when using the autorowheight: true and autoheight: true. I want to set the height to like 500, but that doesn’t do anything when I have these other two options set. Is there something similar to a maxheight available. I looked but don’t see it in the API. For now I’m using pageable: true to limit how high the grid can grow.
I also wanted to compliment you on a most excellent product. I have tried all the libraries and I mean “ALL” the libraries that are available to buy or for free and yours is by far the most developer friendly I have found. I would also like to comment on the excellent customer service I have recieved. I’m just a trial user now but you have definitely earned yourself a paying customer. I will be happily purchasing within the next couple of days and glad to be on board with you guys! See you around the boards.
I guess you’ll just have to take my word for it that it is the div tag for the jqxgrid object and it is printing. Sorry for all the extra posts.
Hmmm… Ok well..not sure why it refuses print. How about this $output .= ” “;
For some reason its not printing my output variable so I’m trying it in here:
$output .= “
“;
Hi Peter,
Thank you for your response Peter!
It occurred to me that I probably didn’t provide enough information in my prior post but I didn’t want to overload the post in case someone was familiar with the problem.Here is the code to go along with the steps:
1) data.php
data.php:
$row[‘buyer_id’],
‘Response Date’ => $row[‘response_date’],
‘Response’ => $row[‘response’]
);
}
echo json_encode($responses);2)Your request: initializing the Grid.
$(document).ready(function()
{
// prepare the data
var source ={
datatype: “json”,
datafields: [{ name: ‘buyer_id’ },{ name: ‘response_date’ },{ name: ‘response’ },],
url: ‘data.php’
};$(“#jqxgrid”).jqxGrid({
source: source,
theme: ‘classic’,
columns: [{ text: ‘Buyer ID’, datafield: ‘buyer_id’, width: 100 },{ text: ‘Reponse Date’, datafield: ‘response_date’, width: 150 },{ text: ‘Response’, datafield: ‘response’, width: 500 }]
});
});3)Data output:
$output .= “
“;
To be output later: print $output;Like I mentioned in my prior post, I don’t have any problems seeing the grid, it’s just that I get blank data.
When I run data.php from the command_line here is the output of the json_encode() function and it is exactly what I expect to see:
[{“Buyer ID”:”23″,”Response Date”:”2013-05-17″,”Response”:”Accepted”},{“Buyer ID”:”23″,”Response Date”:”2013-05-17″,”Response”:”Failed: Invalid SID”}]Thanks for any help you can provide!
Scott
-
AuthorPosts