Forum


14:59

23/03/2009

I'm going through the "Creating your first grid" tutorial, and have set up the data, the index.html and example.php as suggested. However, when I run the page, I get the grid layout, but no data inside it. I have added al query to index.php as well:
$db = mysql_connect('localhost', 'myuser', 'mypassword') or die("Connection Error: " . mysql_error());
$myinv=mysql_select_db('mydatabase', $db) or die("Error connecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
echo "Number of records: ".$count;
and this shows, below the empty grid:
Number of records: 2
as expected (there are two records in the db table), which suggests access to the db is OK.
The Firebug console gives the Response as:
<?xml version='1.0' encoding='utf-8'?><rows><page>1</page><total>1</total><records>2</records><row id
='2'><cell>2</cell><cell>2009-03-24</cell><cell>24.00</cell><cell>3.00</cell><cell>27.00</cell><cell
><![CDATA[watch re payment]]></cell></row><row id='1'><cell>1</cell><cell>2009-03-23</cell><cell>5.00
</cell><cell>1.00</cell><cell>6.00</cell><cell><![CDATA[first entry]]></cell></row></rows>
which seems to suggest that XML is making it back to the page, but is just not being displayed for some reason.
Any suggestions on what might be wrong?
I'm using Firefox 3.0.1 on openSUSE 10.2.
Thanks
Kevin
03:17

Moderators
30/10/2007

Hello,
Remove or comment this line:
echo “Number of records: “.$count;
and see what is happen.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
03:50

23/03/2009

I had just added this query to index.html in order to be sure that some data was being returned from the db - I've taken it out now. What I don't understand is that data is definitely coming back from the db (as this query showed) and Firebug seems to be showing a properly formatted response, but no data is appearing in the grid.
04:01

23/03/2009

I've downloaded the non-minified jquery-1.3.2 from their site, and renamed it to jquery.js. Running the page, Firebug says there is a problem at line 3633:
// Send the data
3632 try {
3633 xhr.send(s.data);
3634 } catch(e) {
3635 jQuery.handleError(s, xhr, null, e);
3636 }
This doesn't mean much to me, I'm afraid
11:10

Moderators
30/10/2007

Hello,
Something is wrong with your request. I recommend first - get the generated xml and use it as datatype: 'xmlstring' in the grid. Refer in the docs and examples
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
28 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66