Title: TypeError: $.data(...) is undefined Post by: Alfred on October 21, 2019, 07:57:08 PM Whenever I call a function to open a dialog which has a datagrid, I got the following error in the console.
Code: TypeError: $.data(...) is undefined However this error does not cause any misbehaviour in my application. My code goes like this: Code: function openDialog(){ datagridview.php Code: <body> I tested the code in Firefox, Chrome, Internet Explorer 11. I do not see any misbehavior. But since It is an error, I want to get rid of it. Please help. Thanks Alfred Title: Re: TypeError: $.data(...) is undefined Post by: stworthy on October 23, 2019, 07:57:09 PM Your 'datagridview.php' should be:
Code: <table id="dg" data-options="fit:true" class="easyui-datagrid"> No error occurs on the console. Title: Re: TypeError: $.data(...) is undefined Post by: Alfred on October 27, 2019, 09:44:29 PM Thanks for the reply.
the datagridview.php contains a a datagrid definion. It has a different url for getting the datagrid json. So the complete code looks like below: This code is in index.php: Code: function openDialog(){ We have another file datagridview.php, which has the following datagrid code: Code: <table id="dg" data-options="url:view.php" class="easyui-datagrid"> So when we run Code: openDiaglog() TypeError: $.data(...) is undefined easyui.min.js:1:245666 getPager http://test.com/js/easyui.min.js:1 datagrid http://test.com/js/easyui.min.js:1 loaded http://test.com/js/easyui.min.js:1 jQuery 2 loaded http://test.com/js/easyui.min.js:1 datagrid http://test.com/js/easyui.min.js:1 _78f http://test.com/js/easyui.min.js:1 success http://test.com/js/easyui.min.js:6 jQuery 4 I hope you can fix the error. Thanks and regards, Alfred Title: Re: TypeError: $.data(...) is undefined Post by: stworthy on October 28, 2019, 02:33:58 AM Please look at this example https://www.jeasyui.com/demo/test/test8.html. It works fine.
test8_1.php Code: <table id="dg" data-options="fit:true,url:'test8_2.php'" class="easyui-datagrid"> test8_2.php Code: <?php Title: Re: TypeError: $.data(...) is undefined Post by: Alfred on October 28, 2019, 07:52:35 PM Thanks for the reply.
Your example just works fine, yet the error still exists in my attempted code. It may be due to the way the pagination works. In your example the pagination is not included. I am using jquery 1.12.4. and easyui 1.7.x. |