Jquery统一更新不起作用
我正在我正在从事的项目之一中使用jquery Uniform。由于这是管理面板,我确实没有选择显示。我将解释我的问题
我想做的事情非常简单。我使用ajax向页面添加一些表单元素(如选择、复选框、文本输入)。
除了重新设计那些动态添加的表单元素之外,每件事都有效。
function step2 () {
$.post( siteUrl + "includes/ajax/members/add-subscription.php?do=step2", $("#selectedSubscribers").serialize(), function( data ) {
$('.step2_content').html(data);
$.uniform.update();
});
}
有人遇到过类似的问题吗?即使我的 onClick、onChange 函数都可以正常工作(动态添加表单元素),只是 $.uniform.update();
似乎不起作用。
我认为处理数据可能需要更长的时间,所以 $.uniform.update();在处理数据之前调用,因此我尝试使用 $.ajax
和 async: false
但没有成功。
如果任何经历过此类问题或知道解决方案的人可以帮助我解决此问题,我将很高兴。
先感谢您。
I'm using jquery uniform on one of the project I'm working on. Since this is admin panel, I truly don't have option to show. I will explain my problem
What I'm trying to do is quite simple. I'm adding some form elements (like select, check box, text input) to the page with ajax.
Every single thing works except re-styling those dynamically added form elements.
function step2 () {
$.post( siteUrl + "includes/ajax/members/add-subscription.php?do=step2", $("#selectedSubscribers").serialize(), function( data ) {
$('.step2_content').html(data);
$.uniform.update();
});
}
Anyone experienced similar problem? Even my onClick, onChange functions are working without a problem (dynamically added form elements), it is just, $.uniform.update();
doesn't seem to work.
I thought processing data could take longer time so $.uniform.update(); is called before data is processed so I tried $.ajax
with async: false
with no luck.
I will be glad if anyone who experienced such problem or who knows the solution could help me out with this problem.
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
首次调用 $.uniform() 时,它将所有指定元素收集到受影响元素的内部数组中。当您调用
$.uniform.update()
时,它只是重新设置那些已经收集的元素的样式。要添加其他元素,您可能需要再次调用
$.uniform()
,传递仅标识那些新的动态添加元素的选择器。When
$.uniform()
is first called, it collects all the specified elements into an internal array of affected elements. When you call$.uniform.update()
it simply restyles those elements that were already collected.To add additional elements, you may need to call
$.uniform()
again, passing a selector identifying only those new, dynamically added elements.对于 load() 如果修复问题
for load() if fix promblem
你试过这个吗?
就我而言,问题已解决。
旧的制服版本可能会导致您的问题。
Have you tried this?
In my case, the problem was solved.
Being old the version of uniform, may cause your problem.
另一种解决方案可能是这个
200 或可能需要更多的数字。
Another solution may be this
200 or a higher number may need.
试试这个:
Try this: