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
Using single XML for Grid and Subgrid
25/02/2013
12:28
Avatar
mod77
New Member
Members
Forum Posts: 2
Member Since:
25/02/2013
sp_UserOfflineSmall Offline

Hello,

I´m using the following script from: http://stackoverflow.com/quest.....e-as-input with some modifications in my grid, but I always get the Error: Uncaught Error: Syntax error, unrecognized expression: zips>zip:has('index:contains('2')')>images i.e..

 

Here´s the XML I produce:

<zips>

<page>0</page>

<total>0</total>

<records>0</records>

<zip>

<index>1</index>

<studio>

<![CDATA[ Adler ]]>

</studio>

<zipname>

<![CDATA[ test2.zip ]]>

</zipname>

<timestamp>

<![CDATA[ 01.01.1970 - 00:00 ]]>

</timestamp>

<zipstatus>

<![CDATA[ <span style="color: green;">OK</span> ]]>

</zipstatus>

<images>

<image>

<id>1</id>

<name>

<![CDATA[ DIA_000006.psd ]]>

</name>

<orgname>

<![CDATA[ sofa6.tif ]]>

</orgname>

<status>

<![CDATA[ <span style="color: green;">OK</span> ]]>

</status>

</image>

</images>

</zip>

<zip>

<index>1</index>

<studio>

<![CDATA[ Adler ]]>

</studio>

<zipname>

<![CDATA[ test.zip ]]>

</zipname>

<timestamp>

<![CDATA[ 01.01.1970 - 00:00 ]]>

</timestamp>

<zipstatus>

<![CDATA[ <span style="color: green;">OK</span> ]]>

</zipstatus>

<images>

<image>

<id>1</id>

<name>

<![CDATA[ DIA_000005.psd ]]>

</name>

<orgname>

<![CDATA[ sofa5.tif ]]>

</orgname>

<status>

<![CDATA[ <span style="color: green;">OK</span> ]]>

</status>

</image>

<image>

<id>1</id>

<name>

<![CDATA[ DIA_000004.psd ]]>

</name>

<orgname>

<![CDATA[ sofa4.tif ]]>

</orgname>

<status>

<![CDATA[ <span style="color: green;">OK</span> ]]>

</status>

</image>

<image>

<id>1</id>

<name>

<![CDATA[ DIA_000003.psd ]]>

</name>

<orgname>

<![CDATA[ sofa3.tif ]]>

</orgname>

<status>

<![CDATA[ <span style="color: green;">OK</span> ]]>

</status>

</image>

<image>

<id>1</id>

<name>

<![CDATA[ DIA_000002.psd ]]>

</name>

<orgname>

<![CDATA[ sofa2.tif ]]>

</orgname>

<status>

<![CDATA[ <span style="color: green;">OK</span> ]]>

</status>

</image>

</images>

</zip>

</zips>

 

And here´s the Gird with my modifs:

        </script>            $("#list_<?= $_GET['tab']; ?>").jqGrid('filterToolbar', { searchOnEnter: false, enableClear: false });            $("#list_<?= $_GET['tab']; ?>").jqGrid('navGrid','#pager_<?= $_GET['tab']; ?>',{edit:false,add:false,del:false,reload:true,search:false});            });                }                    });                        rowNum:1000                        height: "100%",                        gridview:true,                        },                            repeatitems: false                            row:">image",                            root:"zips>zip:has('index:contains('"+row_id+"')')>images",                        xmlReader: {                        ],                            {name:"status", index:"status", width:309, xmlmap:"status"}                            {name:"orgname", index:"orgname", width:309, xmlmap:"orgname"},                            {name:"name", index:"name", width:277, xmlmap:"name"},                            {name:"id",   index:"id",   width:30, xmlmap:"id", key:true},                        colModel: [                        datastr: myXMLdata,                        datatype:'xmlstring',                        colNames:['ID','Dateiname','Originalname','Status'],                    $("#" + subgrid_table_id).jqGrid( {                    $("#" + grid_id).html("<table id='" + subgrid_table_id + "''></table>");                    var subgrid_table_id = grid_id + "_t";                subGridRowExpanded: function(grid_id, row_id) {                toolbarfilter : true,                subGrid: true,                caption: "Bildinfos sammeln",                //postData: {fotostudio: 'Adler', zipname: 'test.zip'},                },                    }                        myXMLdata = data; // save original XML data                    if (data.nodeType) {                    // test whether we have initial loadind and the "data" has XML type                loadComplete: function(data) {                },                    repeatitems: true                    row: "zip",                     root: "zips",                 xmlReader : {                pager: '#pager_<?= $_GET['tab']; ?>',                sortable: true,                sortorder: "asc",                sortname: 'Fotostudio',                loadonce: true,                rownumbers:true,                viewrecords: true,                ignoreCase: true,                rowList:[25,50,100],                rowNum:25,                height: 640,                ],                    {name:'zipstatus',index:'zipstatus', width:282, search:true, xmlmap:">zipstatus"}                    {name:'datum',index:'datum', width:282, search:true, xmlmap:">timestamp"},                    {name:'zipname',index:'zipname', width:282, search:true, xmlmap:">zipname"},                    {name:'fotostudio',index:'fotostudio', width:282, search:true, xmlmap:">studio"},                    {name:'index',index:'index', width:30, search:true, xmlmap:">index", key: true},                colModel:[                colNames:['ID','Fotostudio','Zipname','Datum','Status'],                datatype: "xml",                url: './include/php/flow1_ziplist.php',            $("#list_<?= $_GET['tab']; ?>").jqGrid({var myXMLdata;

 

I tested several other modifikations, but I always get not output with "Loading" when the subgrid opens via "+"… Thanks in advance…

 

Dom

27/02/2013
04:12
Avatar
mod77
New Member
Members
Forum Posts: 2
Member Since:
25/02/2013
sp_UserOfflineSmall Offline

Hi,

there was a problem with the single quotes:

this line: root: "zips>zip:has('id:contains('" + row_id + "')')>images",

should be: root: "zips>zip:has(id:contains('" + row_id + "'))>images",

so after some other changes the code works. Unfortunately the toolbar search doesn´t seem to work:

TypeError: Cannot read property 'stype' of undefined

Any ideas on this. Thx

Regards

Dom

27/02/2013
09:50
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

It is very difficult to read your code.

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
202 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