Forum


11:34

11/03/2010

hello,
I'am still fighting with jqgrid in my DNN project, and I meet a Big Problem, like this:
Problem:
The jqgrid can only live in the Home Page of the DNN(Home page is the first page of dnn site, when you get on the site, the home page will be added firstly, then you could click the page tab, change to the other web pages). That means, if you put the jqgrid at any of the page out of the home page, it will crash when you load the page.
Repeat:
Your could repeat the problem simply like this:
1.Prepare a standard DNN(over 4.8).
2.Just make a simple user-design module, and put the jqgrid into it.
3. Put the module into a test page and point the test page as the home page (in the DNN site-setting), the jgrid will work fine.
4. now point another page as the home page, and you should click on the page tab to view the test page with jqgrid on it. You will see, the loading of the test page will fail, and you will see it report a lot of JS errors.
Reason:
I found the problem happend for the jqgrid try to load data when the DNN page is loading. All the JS errors is raised by the loadErrorHandler.
-----------------------------
function jqGrid_aspnet_loadErrorHandler(xht, st, handler) {jQuery(document.body).css('font-size','100%'); jQuery(document.body).html(xht.responseText);}
var _theForm = document.getElementsByTagName('FORM')[0];
jQuery(_theForm).submit( function()
{
jQuery('#dnn_ctr620_View_jqGrid3_SelectedRow').attr('value', jQuery('#dnn_ctr620_View_jqGrid3').getGridParam('selrow'));
});
})
------------------------------
In the JS function of the loadErrorHandler, it try to do: jQuery(document.body).html(xht.responseText), this will report "Object expected" from the DNN's core code, because the DNN core code will maintain the page by it own way, you can not do jQuery(document.body).html(xht.responseText) here. That explained how the jqgrid loaderror lead a series JS errors in the DNN page and crashed the system, when it meet the loadError.
Now the problem is, why the jqgrid will give a loading error? I set ervery correctly, I write in the Sub OnInit() of the ascx like this:
Dim dt As New DataTable
Dim dr As DataRow
dt.Columns.Add("TableID")
dt.Columns.Add("123")
jqGrid3.DataSource = dt
jqGrid3.DataBind()
Just like the demo told us to do. Yes, on the client-side JS, I set the jqgrid correctly too. Because this works fine when the page hold jqgrid is set as th home page of DNN.
But, when you just change the home page, that means, you need to click on the page tab to chose the "test page" to view, and the test page loading itself by DNN, you will see the jqgrid on it report the loadError. I have tested, at this situation, the sub OnInit() is be executed, so the databind() is exccuted. To make it more clearly, I deleted the code in the OnInit() and just set the DatasourceID in the ascx file where point to a SQL server datasource, and bind to the jqgrid like the demo set.
The result is the same, when you point to the page, the jqgrid still raise a loadingerror. And if you set the page as the home page of DNN, the jqgrid works fine again.
So I don't know why the jqGrid_aspnet_loadErrorHandler is raised at this situation, the code is the same, but only the page is the home page, or not.
And, I think jQuery(document.body).html(xht.responseText) can't be used, that will conflict with the DNN core code, that crashed the whole page. But the main problem is still why the loadErrorHandler is raised.
I am very anxious, I don't know if I should still try this....
yours,
Ivan
20:25

Moderators
30/10/2007

Hello,
Not sure, but maybe you will need to post here
http://www.trirand.net/forum/ - ASP.NET forum
Best Regards
Tony
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.
Most Users Ever Online: 715
Currently Online:
69 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66