在JQuery模板中创建处理程序 [英] Creating handlers in JQuery Templating

查看:65
本文介绍了在JQuery模板中创建处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要在渲染模板内的每个元素之前和之后传递处理程序.
在传递时,我需要发送数据项和元素,因为用户可以操纵元素属性.
目前,我正在为此使用MS Ajax模板.
这是我的代码:

Hi,
I need to pass the handler before and after rendering every element inside the template.
While passing, I need to send the dataitem and also an element because user can manipulate the element attributes.
Currently I am using MS Ajax template for that.
Here is my code:

<td sys:codebefore="before($element,$dataItem)" sys:codeafter="after($element,$dataItem)>
</td>
<td sys:codebefore="before($element,$dataItem)" sys:codeafter="after($element,$dataItem)>{{Name}}
</td>


在这里,我分别在呈现html之前和之后分别调用了"before"和"after"方法.
参数为$ element,而$ dataItem和$ element将引用td元素.
但是在jquery中,jquery中的元素没有作用域.
像以上所述,我需要在JQuery模板中具有等效功能.

请让我知道我的问题是否有任何澄清.等待您的答复


Here I just called ''before'' and ''after'' method before and after rendering the html respectively.
Arguments are $element and $dataItem and $element will refer the td element.
But in jquery templating no scope for element inside jquery.
Like the above I need equivalent in JQuery Templating.

Please let me know if any clarification in my question. Waiting for your reply

推荐答案

element,


dataItem)" sys:codeafter ="
dataItem)" sys:codeafter="after(


元素,


这篇关于在JQuery模板中创建处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆