🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #50775

Re: jqgrid nie wyświetla się

#50775
From: mmiarecka
Date: Tue, 07 Jun 2011 13:47
118 lines
8082 bytes
On May 28, 10:55 pm, janusz_kk1 <janusz...@o2.pl> wrote:
> Witam
> Jestem tu nowy, mam pewne doświadczenie w programowaniu ale
> javascripta się dopiero uczę, chciałem zastosować
> taki komponent do wyswietlania gridów-jqgrid, ściągłem demo
> uruchomiłem krasnala i d..pa, nic nie wyświetla,
> wybrałem najprostszy przykład bez php-a i nic,
> jak dałem alert to wyświetla czyli plik *.js jest uruchamiany
> oto kod:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" lang="pl" xml:lang="pl">
> <head>
>        <meta http-equiv="Content-Type" content="text/html;  
> charset=iso-8859-2" />
>        <title>Test</title>
>        <link rel="stylesheet" type="text/css" media="screen"  
> href="css/jquery-ui-1.8.2.custom.css" />
>                 <link rel="stylesheet" type="text/css" media="screen"  
> href="css/ui.jqgrid.css" />
>                 <script type="text/javascript" src="js/jquery.min.js"></script>
>                 <script type="text/javascript"  
> src="js/jquery-ui-1.8.2.custom.min.js"></script>
>                 <script type="text/javascript" src="js/grid.locale-pl.js"></script>
>                 <script type="text/javascript" src="js/jquery.jqGrid.min.js"></script>
>        <script type="text/javascript" src="rowedex1.js"> </script>
> </head>
> <body>
>
> <table id="list47"></table>
> <div id="plist47"></div>
>
> </body>
> </html>
>
> i java
>
> var mydata = [
>                 {id:"1",invdate:"2010-05-24",name:"test",note:"note",tax:"10.00",total:"2111.00"}  
> ,
>                 {id:"2",invdate:"2010-05-25",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
>                 {id:"3",invdate:"2007-09-01",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
>                 {id:"4",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
>                 {id:"5",invdate:"2007-10-05",name:"test2",note:"note2",tax:"20.00",total:"320.00"},
>                 {id:"6",invdate:"2007-09-06",name:"test3",note:"note3",tax:"30.00",total:"430.00"},
>                 {id:"7",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"},
>                 {id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"21.00",total:"320.00"},
>                 {id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
>                 {id:"11",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
>                 {id:"12",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
>                 {id:"13",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
>                 {id:"14",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
>                 {id:"15",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
>                 {id:"16",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
>                 {id:"17",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
>                 {id:"18",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
>                 {id:"19",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
>                 {id:"21",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
>                 {id:"22",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
>                 {id:"23",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
>                 {id:"24",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
>                 {id:"25",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
>                 {id:"26",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
>                 {id:"27",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
>                 {id:"28",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
>                 {id:"29",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
>         ];
> jQuery("#list48").jqGrid({
>         data: mydata,
>         datatype: "local",
>         height: 'auto',
>         rowNum: 30,
>         rowList: [10,20,30],
>         colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
>         colModel:[
>                 {name:'id',index:'id', width:60, sorttype:"int"},
>                 {name:'invdate',index:'invdate', width:90, sorttype:"date",  
> formatter:"date"},
>                 {name:'name',index:'name', width:100, editable:true},
>                 {name:'amount',index:'amount', width:80,  
> align:"right",sorttype:"float", formatter:"number", editable:true},
>                 {name:'tax',index:'tax', width:80, align:"right",sorttype:"float",  
> editable:true},        
>                 {name:'total',index:'total',  
> width:80,align:"right",sorttype:"float"},          
>                 {name:'note',index:'note', width:150, sortable:false}          
>         ],
>         pager: "#plist48",
>         viewrecords: true,
>         sortname: 'name',
>         grouping:true,
>         groupingView : {
>                 groupField : ['name']
>         },
>         caption: "Grouping Array Data"
>
> });
>
> Na notebooku starym mam W2000 i operę, próbowałem to także na HateML Pro  
> 1.0 który
> ma własny serwer WWW i też nic. Na innym kompie z Xp także nie działa, a  
> zrobine
> wszystko zgodnie z readme z demo.
> Ma ktoś pomysł czemun to nie chodzi?
>
> PS Oczywiście ścieszki są ok i pliki tam są.
>
> --
> Pozdr
> JanuszK

Wedlug mnie:

1. <script type="text/javascript" src="rowedex1.js"> </script>
powinien znajdowac sie pod <div id="plist47"></div>
2. id w div i table musi byc poyniej uzywany w rowedex1.js - $
('#plist47')
Technical Details
Message-ID: <816d4f2c-487d-4dee-a463-fe6909698232@u19g2000vbi.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!uw.edu.pl!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!news.glorb.com!postnews.google.com!u19g2000vbi.googlegroups.com!not-for-mail
References: <op.vv7lq4a11cvm6g@lap>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!uw.edu.pl!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!news.glorb.com!postnews.google.com!u19g2000vbi.googlegroups.com!not-for-mail
From: mmiarecka <mmiarecka@gmail.com>
Newsgroups: pl.comp.lang.javascript
Subject: Re: jqgrid nie wyświetla się
Date: Tue, 7 Jun 2011 06:47:03 -0700 (PDT)
Organization: http://groups.google.com
Lines: 161
Message-ID: <816d4f2c-487d-4dee-a463-fe6909698232@u19g2000vbi.googlegroups.com>
References: <op.vv7lq4a11cvm6g@lap>
NNTP-Posting-Host: 92.206.240.132
Mime-Version: 1.0
X-Trace: posting.google.com 1307454423 11091 127.0.0.1 (7 Jun 2011 13:47:03 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 7 Jun 2011 13:47:03 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: u19g2000vbi.googlegroups.com; posting-host=92.206.240.132; posting-account=9CK44QoAAACMbYgtYQNJfo5rll0iV5Qb
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: HUALESNKRC
X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1,gzip(gfe)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit