Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Rows missing
18/02/2013
15:45
Avatar
Yaerox
Member
Members
Forum Posts: 8
Member Since:
18/02/2013
sp_UserOfflineSmall Offline

Hey guys,

first of all sry for bad english, but im actual trying to get a simple JQgrid on my Website but I dont get rows in there.

Im running JQuery on an local XAMPP apache2 with Perl. I got a Testscript which is working fine and without any problems. Now I tried to create a .html file just with a JQGrid which should get rows by the name of files which get read out of a directory.

Here is my index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DT.....038;hellip;..t;&gt;
<html lang="de">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Datenverscheiber</title>
    <link href="../../css/redmond/jquery-ui.css" rel="stylesheet">
    <link href="../../layout_plugin/css/layout-default-latest.css" rel="stylesheet">
    <link href="../../jquery.jqGrid-4.4.1/css/ui.jqgrid.css" rel="stylesheet" type="text/css" media="screen"  />
    <script type="text/javascript" src="../../js/jquery-1.8.2.js"></script>
    <script type="text/javascript" src="../../js/jquery-ui-1.9.1.custom.js"></script>    
    <script type="text/javascript" src="../../jquery.jqGrid-4.4.1/js/jquery.jqGrid.src.js"></script>
    <script type="text/javascript" src="../../jquery.jqGrid-4.4.1/js/i18n/grid.locale-de.js"></script>
    <script type="text/javascript" src="../../jquery.jqGrid-4.4.1/plugins/jquery.contextmenu.js"></script>
    <script type="text/javascript" src="../../jquery.jqGrid-4.4.1/plugins/jquery.tablednd.js"></script>
    <script>
        $(document).ready( function () {
            // Tabelle Offen    
            $("#tbl_offen").jqGrid({
                url:'../../../cgi-bin/JQuery/Datenverschieber/offene_daten_lesen.pl',
                datatype: "json",
                postData:{'art':'empfang'},
                jsonReader : {
                  repeatitems: true,
               },
                colNames:['Sendungsnummer','Name','Uebergabedatum', 'Uebergabezeit'],
                colModel:
                [
                    {name:'sendungsnummer',index:'sendungsnummer', width:200, align:"left"},
                    {name:'name',index:'name', width:200, align:"left"},
                    {name:'uebergabedatum',index:'uebergabedatum', width:200, align:"left"},
                    {name:'uebergabezeit',index:'uebergabezeit', width:220, align:"left"}
                ],  
                rowNum:10,
                rowTotal: 10,
                loadtext: 'Offene Dateien werden gelesen…',
                height: '100%',
                width: '100%',
                hidegrid: false,
                sortable: false,
                toppager: false,
                gridview: true,
                viewrecords: true,
                loadonce: true,
                editurl: 'dummy.php',
                gridComplete: function() {
                    jQuery("#tbl_offen").tableDnDUpdate();
                },
                caption: "Offene Dateien"
            });
        });
    </script>
</head>
<body>
<center>
    <div id="toolbar">
    </div>
    <div id="offen">
        <table id="tbl_offen"></table>
    </div>
    <div id="senden">
        <table id="tbl_senden"></table>
    </div>
</center>
</body>
</html>

My perl script works fine, the JSON is correctly

{"total":"1","page":"1","records":"4","rows":[{"sendungsnummer":"XXX","name":"test.txt","uebergabedatum":"XXX","uebergabezeit":"XXX"}{"sendungsnummer":"XXX","name":"test2.txt","uebergabedatum":"XXX","uebergabezeit":"XXX"}{"sendungsnummer":"XXX","name":"test3.txt","uebergabedatum":"XXX","uebergabezeit":"XXX"}{"sendungsnummer":"XXX","name":"test4.txt","uebergabedatum":"XXX","uebergabezeit":"XXX"}]}

but for example in Firebug, if I click Console > All > POST … i dont get the category JSON. Same Server just a running script of a friend working fine (like I already said), there I get the JSON category, so there shouldn't be missing any plugins or whatever.

I hope someone can help me (:

18/02/2013
22:31
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

In your case I think you should set repeatitems to false and not to true,

Replace the jsonReader with:

...

jsonReader : {

    repeatitems : false,

}

...

You will need just to look into docs here

Regards

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.

20/02/2013
09:15
Avatar
Yaerox
Member
Members
Forum Posts: 8
Member Since:
18/02/2013
sp_UserOfflineSmall Offline

Ohh, missed to edit this. My jsonReader is exaclty like yours. But still dont get any rows.

20/02/2013
11:14
Avatar
Yaerox
Member
Members
Forum Posts: 8
Member Since:
18/02/2013
sp_UserOfflineSmall Offline

Found it. Just missed the ',' after each row :/

Thanks.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
16 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information