Title: TreeGrid in dynamic Tabs
Post by: mzeddd on September 26, 2011, 01:48:22 AM
Hi, In my project I use TreeGrid:s which I load into new Tab:s. Everythinig is fine but browser points me on one error (Opera output) [26.09.2011 12:25:46] JavaScript - http://tol2/ Unknown thread Uncaught exception: TypeError: Cannot convert '$.data(jq[0],"datagrid")' to object Error thrown at line 7020, column 0 in <anonymous function: getPager>(jq) in http://tol2/lib/jquery-easyui-1.2.4/jquery.easyui.min.js: return $.data(jq[0],"datagrid").panel.find("div.datagrid-pager"); called from line 6855, column 0 in <anonymous function: $.fn.datagrid>(_4b9, _4ba) in http://tol2/lib/jquery-easyui-1.2.4/jquery.easyui.min.js: return $.fn.datagrid.methods[_4b9](this,_4ba); called from line 7072, column 0 in <anonymous function: loaded>() in http://tol2/lib/jquery-easyui-1.2.4/jquery.easyui.min.js: $(this).datagrid("getPager").pagination("loaded"); called via Function.prototype.call() from unknown location in <anonymous function: each>(a, c, d) in http://tol2/lib/jquery-easyui-1.2.4/jquery-1.6.min.js: /* no source available */ called from line 16, column 17676 in <anonymous function: each>(a, b) in http://tol2/lib/jquery-easyui-1.2.4/jquery-1.6.min.js: return e.each(this,a,b) called from line 7071, column 0 in <anonymous function: loaded>(jq) in http://tol2/lib/jquery-easyui-1.2.4/jquery.easyui.min.js: return jq.each(function(){ called from line 6855, column 0 in <anonymous function: $.fn.datagrid>(_4b9, _4ba) in http://tol2/lib/jquery-easyui-1.2.4/jquery.easyui.min.js: .....
In my code I create Tab and load PHP page into it. Here is this PHP code <?php
$toSelect = trim($_GET['toSelect']);
if($toSelect==""){ echo "Test Object not found"; die; } ?> <table id="<?php echo $toSelect;?>" width="100%" fit="true"></table> <script> $(function(){ $('#<?php echo $toSelect;?>').treegrid({ animate:false, collapsible:true, url:'lib/json_tcSearch.php?action=tcLoad&toSelect=<?php echo $toSelect;?>' + '&version='+hiddenForm.version.value.replace(/ /g,"+") + '&prio='+hiddenForm.prio.value.replace(/ /g,"+") + '&tqr='+hiddenForm.tqr.value.replace(/ /g,"+") + '&config='+hiddenForm.config.value.replace(/ /g,"+") + '&feature='+hiddenForm.feature.value.replace(/ /g,"+") + '&automation='+hiddenForm.automation.value.replace(/ /g,"+") + '&standard='+hiddenForm.standard.value.replace(/ /g,"+") + '&tcIdMask='+hiddenForm.tcIdMask.value.replace(/ /g,"+") + '&tcReqMask='+hiddenForm.tcReqMask.value.replace(/ /g,"+") + '&tcSloganMask='+hiddenForm.tcSloganMask.value.replace(/ /g,"+") + '&tcCommentMask='+hiddenForm.tcCommentMask.value.replace(/ /g,"+"), idField:'id', treeField:'tcName', showFooter:true, pagination:false, columns:[[ {field:'tcName',title:'ID',width:160}, {field:'tcSlogan',title:'Slogan',width:380}, {field:'tcPrio',title:'Prio',width:50}, {field:'tcReq',title:'Requirement',width:150} ]], onContextMenu: function(e,row){ e.preventDefault(); $(this).treegrid('unselectAll'); $(this).treegrid('select', row.code); $('#contextMenu').menu('show', { left: e.pageX, top: e.pageY }); }, toolbar:[{ text:'Open All', handler:function(){ $('#<?php echo $toSelect;?>').treegrid('expandAll'); } },{ text:'Close All', handler:function(){ $('#<?php echo $toSelect;?>').treegrid('collapseAll'); } },{ text:'Export', iconCls:'icon-excel', handler:function(){ alert('Dummy button O_o'); } }] }); }); </script>
I don't have this problem when code above exists in main PHP page. This means I don't need to load Tab content from outside. Can anybody tell me how to get rid of this problem? It does not breake any functionality, but I don't want to see warning from IE(in case of IE) about this problem. Thanks in advance, Valery
Title: Re: TreeGrid in dynamic Tabs
Post by: mzeddd on December 09, 2011, 10:40:07 PM
This problem is no longer visible with 1.2.5 version :)
|