本文介绍了jQuery的统一更新不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是我的工作项目之一jQuery的统一。由于这是管理面板,我真的没有选择显示。我会解释我的问题

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

我试图做的是很简单的。我加入了一些表单元素(如选择,复选框,输入文本)在页面使用Ajax。

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();
    });
 }

任何人都遇到过类似的问题?甚至我的onClick,的onChange职能工作没有问题(动态添加窗体元素),它是正义的, $ 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.

我认为处理数据可能需要较长的时间,所以$ .uniform.update();之前调用数据的处理,所以我尝试 $ AJAX 异步:。假,没有运气

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.

感谢你在前进。

推荐答案

$。统一的()第一次被调用,它收集所有指定的元素融入到一个内部数组受影响的元素。当你调用 $。uniform.update()它只是restyles那些已经收集到的元素。

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.

这篇关于jQuery的统一更新不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 09:57