Witam mam dosyc dziwny problem z korzystaniem z jquery + jgrid.
Sprawa wyglada tak, mam schemat zrobiony ktory dziala i nie mam zadnych problemow z nim, problem pojawia sie w momencie zainkludowanie tego statycznego html w php w tym momencie html sie inkluduje poprawnie za to nie inkluduje sie poprawnie cale jquery brakuje funkcji odpowiedzialnych za jgrid. I szczeze powiem nie iwem co moze byc przyczyna tego :(
Kolejność w której umieszczasz jquery i jgrid ma znaczenie?
Sprawdź to i jak coś to daj fragmenty kodu, będzie łatwiej nam znaleźć.
Niestety nie znam w ogóle jGrid.
<style>
html, body {
margin: 0; /* Remove body margin/padding */
padding: 0;
overflow: auto; /* Remove scroll bars on browser window */
font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
}
</style>
<!-- In head section we should include the style sheet for the grid -->
<link rel="stylesheet" type="text/css" media="screen" href="/development_aj/aldec_backup/panda/themes/green/grid.css" />
<!-- Of course we should load the jquery library -->
<script src="/development_aj/aldec_backup/panda/js/jquery.js" type="text/javascript"></script>
<!-- and at end the jqGrid Java Script file -->
<script src="/development_aj/aldec_backup/panda/js/jquery.jqGrid.js" type="text/javascript"></script>
<script type="text/javascript">
// We use a document ready jquery function.
jQuery(document).ready(function(){
jQuery("#list2").jqGrid({
url:'example.php?nd='+new Date().getTime(),
datatype: "json",
colNames:['id','Host', 'Group', 'MAC','Agent Version','Last Info','IP','User Logged','Last See'],
colModel:[
{name:'id', index:'IDComputer', width:30,align:"center"},
{name:'Host',index:'Host', width:90, align:"center"},
{name:'Group',index:'Group', width:50},
{name:'MAC',index:'MAC', width:120, align:"center"},
{name:'AgentVersion',index:'AgentVersion', width:90, align:"right"},
{name:'LastInfoDate',index:'LastInfoDate', width:140,align:"right"},
{name:'DefaultIP',index:'DefaultIP', width:100,},
{name:'OsLoggedUser',index:'OsLoggedUser', width:130},
{name:'LastAgentConfig',index:'LastAgentConfig', width:155}
],
pager: jQuery('#pager2'),
rowNum:20,
rowList:[10,20,30],
imgpath: 'themes/sand/images',
sortname: 'IDComputer',
viewrecords: true,
sortorder: "asc",
caption: "Panda AntyVirus"
});
});
</script>
</head>
<body>
<!-- the grid definition in html is a table tag with class 'scroll' -->
<table id="list2" class="scroll" cellpadding="0" cellspacing="0"></table>
<!-- pager definition. class scroll tels that we want to use the same theme as grid -->
<div id="pager2" class="scroll" style="text-align:center;"></div>
mieć czasem w pliku php, który includuje html, w sekcji head- tego co masz w sekcji head pliku html?
Ja bym w pliku php sprawdzal co jest includowane i jeżeli będzie to dany plik, to w sekcji head (w tym pliku php) zaincludowalem dodatkowo plik:
--------------------------------------------------------------------
<link rel="stylesheet" type="text/css" media="screen" href="/development_aj/aldec_backup/panda/themes/green/grid.css" />