This is a migrated thread and some comments may be shown as answers.

[Solved] how use the grid in a window dialog

7 Answers 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alexandre Jobin
Top achievements
Rank 1
Alexandre Jobin asked on 06 Dec 2010, 10:23 PM
hi!

in my MVC web page, i would like to click on a button that will call, via ajax, a function that will return a PartialView with the grid. The window dialog open and the grid is there but i have problems with it. It can't call anything in ajax mode! Everytime i click a column to sort it or the pager to change the page, its the whole page that get refreshed with errors. Its like if the Ajax mode havent been enabled.

I probably have an idea why it doesnt work but im not sure. When i check the html code that is bring back from the ajax call to open the dialog window, it bring the html + javascript code. In the javascript code, there's only this line:

jQuery('#demo').tGrid({columns:[{"title":"Code","member":"Code"....

since that this code is not wrapped in the jQuery ready function, the command is lunched but it doesnt find everything when it try to configure the grid.

so do you have any idea how to make it work?

thank you!

alex

7 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 07 Dec 2010, 08:32 AM
Hello Alexandre Jobin,

 Have you checked this help topic?

Best wishes,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alexandre Jobin
Top achievements
Rank 1
answered on 07 Dec 2010, 04:54 PM
it doesnt solve the problem. I have attached the code that is generated by my PartialView.
Also, i don't need the scripts because they are already in the main page.
0
Atanas Korchev
Telerik team
answered on 07 Dec 2010, 05:15 PM
Hi Alexandre Jobin,

 The attached partial view output is correct. However I still think that some of the JavaScript files is not included in the parent view. You can verify that all required files are included.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alexandre Jobin
Top achievements
Rank 1
answered on 07 Dec 2010, 05:53 PM
i already have a grid in the main page and i have copied the code of the grid in another partial view that i call via ajax (i've renamed the name of the grid to be sure that theres no conflic). So the scripts are all there to make it work. Since that im only presenting the data with the option to sort them, i only need theses scripts:

telerik.common.js
telerik.grid.js
0
Alexandre Jobin
Top achievements
Rank 1
answered on 07 Dec 2010, 06:05 PM
to simplify the problem, here's what i've done:

  • the main page have a grid in ajax mode
  • the code to generate the grid is copied in a partial view
  • in the main page, after the first grid, i have created en empty <div> tag
  • when i click on a button in the main page, i execute this script: $("#partialviewgrid").load("/Intervenants/Demo");
  • the first grid still have the ajax mode and everything work fine but the new imported one doesnt work when i click on the pager or the headers. It try to call a new page!
alex
0
Atanas Korchev
Telerik team
answered on 08 Dec 2010, 08:19 AM
Hi Alexandre Jobin,

 You've mentioned that you have copied the grid from another location. Please make sure both grids have unique Name. If they do - please try attaching a sample project which demonstrates the problem.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alexandre Jobin
Top achievements
Rank 1
answered on 08 Dec 2010, 07:26 PM
please, don't laugh at me, but i have changed the name of the grid to be sure that the 2 grids would not be in conflic and i gave him a name that was already on the page too. This is why the grid wasnt working properly.

But, the sollution to include the telerik script have solved the problem where i don't have any grid on the main page and a grid in the partial view.

so thank you very much for your time!

alex
Tags
Grid
Asked by
Alexandre Jobin
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Alexandre Jobin
Top achievements
Rank 1
Share this question
or