Welcome Guest Search | Active Topics | Sign In | Register

grid...getting textbox from a custom column Options
anet
Posted: Sunday, March 24, 2013 12:10:16 PM
Rank: Member
Groups: Member

Joined: 3/9/2013
Posts: 16
Hi,
I'm trying to write the ClientSideBeginEdit function for a custom column with an asp text box in it. However, when I do the document.getElementByID call it's not returning my control. Can you point me in the right direction? Code snippets below. Thanks.


Code: JavaScript
function on_begin_edit_salesteam(cell) {
			
			var tb = document.getElementById(eo_GetObject("SalesTeamTx"));
			window.setTimeout(
					function () {
						tb.focus();
					}, 10);
			
		}


Code: HTML/ASPX
<eo:CustomColumn Name="SalesTeamTest" DataField="dist_sales_team" AllowSort="true" ClientSideBeginEdit="on_begin_edit_salesteam" ClientSideEndEdit="on_end_edit_salesteam">
	<EditorTemplate>
		<asp:TextBox ID="SalesTeamTx" runat="server" Height="13" Width="100" onfocus="this.value=''"></asp:TextBox>
		<asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="SalesTeamTx" MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="1000" ServiceMethod="GetSalesTeam" >
		</asp:AutoCompleteExtender>
	</EditorTemplate>
</eo:CustomColumn>
eo_support
Posted: Monday, March 25, 2013 10:05:18 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

eo_GetObject is used with EO controls. It has nothing to do with your asp:TextBox.

Thanks!
anet
Posted: Monday, March 25, 2013 11:16:37 AM
Rank: Member
Groups: Member

Joined: 3/9/2013
Posts: 16
So how would I go about getting the asp:TextBox value...tried several different things, searched online documentation and I can't seem to get it.
eo_support
Posted: Monday, March 25, 2013 11:20:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
anet wrote:
So how would I go about getting the asp:TextBox value...tried several different things, searched online documentation and I can't seem to get it.


You are looking the wrong place ---- that question is a generic ASP.NET programming question. Our support does not answer such questions, so you need to seek other resource for that.
anet
Posted: Monday, March 25, 2013 11:29:55 AM
Rank: Member
Groups: Member

Joined: 3/9/2013
Posts: 16
Wow, okay...even though it's in your grid? When it's outside of your grid I can get it just fine. And I paid for a developer license for your grid! All I want to know is how to get the value of a control when it's in your grid....not asking you to write the code for me. I've spent tons of time trying to figure this out on my own before posting this. I'm not trying to get you to do my work for me. I'm just very frustrated trying to get this to work and it's a showstopper for my client. The grid does so many things really well and I really like the product but I'm running into a wall on this issue. You haven't had this question before?
eo_support
Posted: Monday, March 25, 2013 11:40:33 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Please do not start this debate with us. You are not the first one. We are very firm on this kind of issue. Just like you can not call your car dealer to tell you where to find a gas station just because the question arises while you are driving the car, we do not answer generic programming questions EVEN IF the question arises while you use our product. In order for us to answer a question, the question must be directly related to our product. In this case you are asking how to get the value of an asp:TextBox through JavaScript. This is a question you can run into with or without our product. As such we do not answer such questions.

We do our best to provide the best product and most responsive support, but as a business, we can not afford to answer generic programming questions because doing so would encourage all our customers would try to run their issues through us first no matter it has to do with us or not. Obviously that's not something we can do. Hope you understand.

Thanks!

anet
Posted: Monday, March 25, 2013 12:20:47 PM
Rank: Member
Groups: Member

Joined: 3/9/2013
Posts: 16
Argh...now I'm just feeling insulted. It's not about javascript and an ASP text box. This question is about how to get the value of a control (could be anything) from an editor template of a customcolumn in the eo.webgrid! Is my approach wrong? Is the coulumn set up incorrectly, any feedback at all?
I can use javascript to get the value of an asp:TextBox all day and night and make it work just fine. What I need to know is how to set up this column so I can do that! Maybe my question was not worded well...sorry for that. So far your support has been pretty darn good and I like your product. Just having difficulty seeing what I'm doing wrong here.
eo_support
Posted: Monday, March 25, 2013 12:37:45 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Please do not play the wording game with us. Your question about "This question is about how to get the value of a control (could be anything) from an editor template of a customcolumn in the eo.webgrid". That is the same as "how to get the value of a control (could be anything)", the second part of your question "from an editor template of a customcolumn in the eo.webgrid" is unrelated to your question and does not change the answer to that question.

If you have any question about the CustomColumn, we will be happy to answer. Make sure you clearly state your question and clearly isolate it from the rest of your project. We do not answer questions such as "I want to implement a system that does xxxx, can you tell me how to do it?", or questions like "this code does not work, can you fix it". Nor we review or debug your code. We only answer very specific questions that are directly related to our product.

Thanks!
anet
Posted: Monday, March 25, 2013 1:04:12 PM
Rank: Member
Groups: Member

Joined: 3/9/2013
Posts: 16
I don't understand...I'm not trying to play games of any kind. I really was trying to zoom in on what my difficulty is. I don't want to be snarky or cranky and I apologize if I came off that way.
I know how to get the value of an asp:textbox with javascript but I don't know how to get it from an editor template of a custom column in your grid. I know to use OnClientSideBeginEdit and OnClientSideEndEdit from the documentation. I can get it to work when I use the repeater example you have posted (which is a great example, thanks). I can't get it to return anything when I use other controls though......I also tried to use document.getElementById("SalesTeamTx") the same way I did with the repeater and that didn't work.
I'm just trying to figure out if I can make this work. At this point I just want to know if what I am trying to do is possible. I don't want you to debug my code or write anything for me....I know you can't do that and I understand. I really like a lot of the features of your grid and it's great but I'm having a hard time getting a couple things working. I've searched through the documentation and tried to get this answer on my own. I'm really sorry I haven't figured it on my own or found a similar question that explains this. I'm just looking for some help. Is there any way you could just tell me if it's possible to do this?
eo_support
Posted: Monday, March 25, 2013 1:16:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

I understand your frustration. What we was trying to tell you is there is no such thing as "how to get it from an editor template of a custom column in your grid". That's not even a question. There is NO difference between getting a value of an asp:TextBox anywhere else, and getting a value of an asp:TextBox that's inside the editor template of custom column. In another word, the only question here is "getting a value of an asp:TextBox". Period. That also means, if it is possible for you to get the value of an asp:TextBox anywhere else, it is possible for you to get the value when it is inside the editor template. It also means, if for some reason you can't get the value inside the editor template, then the code that you use to get the value is wrong, and the same problem can occur elsewhere as well. The only question here is "how to do X". You keep attaching it with a completely unrelated condition and asking "how to do X when Y". That's why we told you you were looking at the wrong place in our first reply.

I hope this clears it up. This issue is now closed.

Thanks
anet
Posted: Monday, March 25, 2013 1:18:44 PM
Rank: Member
Groups: Member

Joined: 3/9/2013
Posts: 16
It does! Thank you.
anet
Posted: Tuesday, March 26, 2013 4:22:52 PM
Rank: Member
Groups: Member

Joined: 3/9/2013
Posts: 16
So...not a question...just thought I'd post the answer to my question. The grid renders the textbox with a different ID so for the above case to get the textbox: document.getElementById("ctl00_MainContent_Grid1_edit_ctl11_SalesTeamTx").value

just posting in case someone else needs to figure out!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.