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

Grid Edit - Form Name

10 Answers 83 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.
Jigar
Top achievements
Rank 1
Jigar asked on 08 Oct 2010, 07:46 AM
Hi,

While wiring gird with OnEdit event; I can access form using e.form. But I want to know the form name.

Is there any way to know the form name?

Let me explain the scenario; In my previous post I discussed the problem regarding sub grid problem for components with java script. the possible solution could be, If I access those components with respect to form name.

Please suggest.

Thanks,

Jigar.

10 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 08 Oct 2010, 09:45 AM
Hello Jigar,

 The form name is formed like this grid.Name + "form". However I am not sure if this would help. jQuery needs unique IDs in order to locate items properly. If more than one item exists with the same ID it would fail. 

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
Jigar
Top achievements
Rank 1
answered on 08 Oct 2010, 10:03 AM
Hi Atanas,

Thanks a lot for your reply.

Actually i want to access components with respect to their form.

For Example.
In case of sub grids there are forms with different name like you said, gridName + "form".  Though there are components with same name with all such sub grids but form names are different.

That's why I want to access components with respect to their form name, like $(formName).find('myCombo').data('tDropDownList').

I tried this; It fails. I think with respect to form name it should pick up the the components within that form.

Please let me know if you like to have sample project.

I hope I explained it clearly.

Thanks,

Jigar.
0
Atanas Korchev
Telerik team
answered on 08 Oct 2010, 11:10 AM
Hi Jigar,

 Perhaps you need this

$('#' + formName) 

as this is an id based selector. 

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
Jigar
Top achievements
Rank 1
answered on 08 Oct 2010, 11:27 AM
Hi Atanas,

I did exactly like it; I am initializing form name like var fomName = "#" + gridName + "form".

My Actual problem is this, and trying to solve it using this way.

Please find the sample project on this link. Name: SubGridProblemWithForm

I really appreciate If you can help to solve this.

Thanks,

Jigar.
0
Jigar
Top achievements
Rank 1
answered on 08 Oct 2010, 11:41 AM
Hi,

I am sorry I didn't explain sample project;

In this project when you click on edit button of the sub grid, let's say 1st Sub Grid, I put the alert for the form name, and for drop down list object.

for the first click you can see the correct form Name, and can also see the drop-down list object as [object object], but when you click on another sub grid, you can see the correct form name, but in alert it says null for drop down list object with respect to the form.

Please let me know if any clarification required.
Regards,
Jigar.
0
Georgi Krustev
Telerik team
answered on 11 Oct 2010, 09:53 AM
Hello Jigar,

 Unfortunately it is hard to determine, how you implement the required functionality. Could you please send us a simple test project which reproduces the depicted issue. Thus we will be able to review it locally and advice you further.

Greetings,
Georgi Krustev
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
Jigar
Top achievements
Rank 1
answered on 11 Oct 2010, 04:54 PM
Hi Georgi,

Thanks a lot for your reply. And sorry for making the thing complex.

Please have a look at this forum thread. I have a Master Grid / Sub Grid.

In sub grid I have components like drop-down list, currency text box. These components are not working properly for sub grids. As Rosen explained in above mentioned post it won't work because these components are with javascript attached.

As per my understanding; Each sub grid shall be created with unique name like SubGrid_1, SubGrid_2, ... , SubGrid_N, and for each such grid editor templates are also created with respective form names like SubGrid_1form, SubGrid_2form,... ,SubGrid_Nform. But these forms are with the components having same name.  This is why it will create the problem.

For Example:
I have DropDownList with Ajax binding say, comboList; and I have wired sub grids with OnEdit client event. In this event I want to show the value of the Drop Down List. But this script will fail because each sub grid forms have this combo box with the same name i.e. comboList.

to solve this problem I have tried to access my component i.e. comboList with respect to form name for example: $(formName).find('#comboList').data('tDropDownList'). But I didn't get the success.

This will be the case for each components with javascript for example, currency text box, numeric text box.

You can see the same scenario in this sample project.

Please suggest a work around for this problem. I hope this time I have explained it clearly. Please let me know if any clarifications required.

Thanks a Lot,

Jigar.

 
0
Georgi Krustev
Telerik team
answered on 13 Oct 2010, 03:19 PM
Hello Jigar,

You have encountered a known issue related with the hierarchical grid editing. Once the pop-up window is created, it is reused, which will cause a problem if current editor template is used in more than one grid.

I have attached the modified files, which will fix this problem. This mods will be included in the next official release of the Telerik Components for ASP.NET MVC.

Greetings,
Georgi Krustev
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
Jigar
Top achievements
Rank 1
answered on 14 Oct 2010, 01:54 PM
Hi Georgi,

Thanks a ton for these scripts. Will test it and give feedback.

Thank you very much once again,

Jigar.
0
Jigar
Top achievements
Rank 1
answered on 28 Oct 2010, 06:12 AM
Hi Georgi,

Thanks for the scripts. It has solved my problem. But I am facing new problem with these scripts ( I replaced these scripts in version 930).

Problem:
I have ajax grids; When I click on Refresh button it works fine; but when I click on Edit button in any of the record of the grid and then when I click on Refresh button it gives error in telerik.grid.editing.js.

You may use the sample project I mentioned above.

Thanks,

Jigar.
Tags
Grid
Asked by
Jigar
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jigar
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or