如何在客户端获取 RadButton Toggle State 的 Text 属性? [Telerik ASP.NET AJAX 控件]
我想使用 jquery 或任何其他方式获取它的 Text 属性...
请帮助我...
I want to Get The Text Property Of this using jquery or any other way...
Please help me....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不确定正在寻找什么文本属性,但我必须做类似的事情,所以对于其他人来说...
在按钮调用函数时获取信息
从页面上的按钮开始:
请注意,当用户单击 radbutton 时,将调用 ToggleStateChange 函数(如果您像我一样使用外部 js 文件,请务必添加对您的页面的脚本引用。)
现在,对于该函数:
获取信息另一个元素调用函数
例如,考虑一个自动折叠所有 div 按钮和单个 div 的单独自动折叠/展开按钮。如果打开了所选的自动折叠,则所有 div 都会切换 (divs.toggle();),并且用于折叠或展开 div 的单个按钮需要从折叠切换状态更改为展开切换状态,因为 div 已经折叠。
在调用元素调用的函数中(在我的例子中,自动折叠所有按钮调用 AutoCollapseAllDivs 函数),添加:
注释:
使用 Q2 2011 Telerik Controls
使用外部 js 文件
参考:
radbutton 的基本方法: http: //www.telerik.com/help/aspnet-ajax/button-client-side-basics.html
获取切换信息的示例有点难找到,但这里有一个:
http://demos.telerik.com/aspnet-ajax/button /examples/clientsideevents/defaultcs.aspx
Not sure what text property was being looked for, but I had to do something similar, so for anyone else looking...
Getting information when the button is invoking the function
Start with your button on your page:
Notice that when the user clicks the radbutton, the ToggleStateChange function is called (be sure to add a script reference to your page if you are using an external js file like me.)
Now, for the function:
Getting the information when another element invokes a function
For example, think of an auto collapse all divs button and individual auto collapse/expand button for a single div. If the auto collapse selected was turned on, all divs would toggle (divs.toggle();) and the individual button to collapse or expand the div needed to change from the collapse toggle state to the expand toggle state since the divs are already collapsed.
In the function that is called by the invoking element(in my case the auto collapse all button calling the AutoCollapseAllDivs function), add:
Notes:
Using Q2 2011 Telerik Controls
Using external js file
References:
The basic methods for the radbutton: http://www.telerik.com/help/aspnet-ajax/button-client-side-basics.html
Examples for getting toggle information are a little harder to find, but here is one:
http://demos.telerik.com/aspnet-ajax/button/examples/clientsideevents/defaultcs.aspx
您应该获取当前选定的 ToggleState,然后从 ToggleState 中获取文本。
这是一个示例代码片段:
You should get the currently selected ToggleState, and then get the text from the ToggleState.
Here is a sample code snippet: