首页 \ 问答 \ jQuery UI主题在datatables插件中(jQuery UI theming within datatables plugin)

jQuery UI主题在datatables插件中(jQuery UI theming within datatables plugin)

我正在使用jquery datatables插件并在表格页脚中添加了一些自定义jquery-ui按钮。 要使用带有jquery-ui的datatables插件,必须打开“bJQueryUI”选项。

到目前为止没有问题,但现在我将jquery-ui themeroller添加到了我的页面。

当我更改主题时,所有jquery-ui组件都会相应地更改其样式,就像数据表一样,除了数据表中的按钮。

我发现它实际上是一个css优先级问题:themeroller应用的新样式的优先级低于原始样式,因此这些按钮永远不会改变它们的外观。

由于jquery-ui组件和datatables插件都很受欢迎,我以为我会找到有类似问题的人,但到目前为止没有运气...

这就是如何完成数据表的初始化和自定义按钮的创建:

<table id="DataTable">
// ...
</table>
<script type="text/javascript">
    $(function ()
    {
        var oDataTable = $('#DataTable').dataTable({
            "aaData": result.aaData,
            "bPaginate": false,
            "bJQueryUI": true,
            "bInfo": true,
            "sDom": '<"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ipT<"toolbar">>',
            "oTableTools":
            {
                "sRowSelect": "single"
            }
        });
        // add buttons
        $("div.toolbar").html('<button id="AddButton">New element</button>');
        $("#AddButton").button().click(function () { /* ... */ });
        // add more buttons...
    }
</script>

这是实际html结构和应用的css样式的屏幕截图: http//i.stack.imgur.com/vbAuy.jpg

非常感谢任何提示。


I'm using the jquery datatables plugin and added some custom jquery-ui buttons to the table footer. To use the datatables plugin with jquery-ui theming the "bJQueryUI" option has to be turned on.

So far no problem, but now I added the jquery-ui themeroller to my page.

When I change the theme, all the jquery-ui components change their style accordingly, just like the datatable, except for the buttons within the datatable.

I found out that it actually is a css-priority issue: the new styles applied by the themeroller got lower priority than the original styles, so these buttons never change their look.

As the jquery-ui components and the datatables plugin both are quite popular I thought I would find someone with similar problems, but had no luck so far..

That's how the initialization of the datatable and the creation of the custom buttons are done:

<table id="DataTable">
// ...
</table>
<script type="text/javascript">
    $(function ()
    {
        var oDataTable = $('#DataTable').dataTable({
            "aaData": result.aaData,
            "bPaginate": false,
            "bJQueryUI": true,
            "bInfo": true,
            "sDom": '<"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ipT<"toolbar">>',
            "oTableTools":
            {
                "sRowSelect": "single"
            }
        });
        // add buttons
        $("div.toolbar").html('<button id="AddButton">New element</button>');
        $("#AddButton").button().click(function () { /* ... */ });
        // add more buttons...
    }
</script>

Here's a screenshot of the actual html structure and applied css-styles: http://i.stack.imgur.com/vbAuy.jpg

Any hint is greatly appreciated.


原文:https://stackoverflow.com/questions/6728393
更新时间:2023-01-13 16:01

最满意答案

我认为您的计算机与VT-x/HAXM技术不兼容,或者您​​尚未安装。

打开Android Sdk管理器。

  1. 转到android-sdk目录并选择tools文件夹。
  2. 运行android文件。
  3. 检查是否安装了HAXM

在此处输入图像描述

如果未安装,请尝试安装并检查是否显示错误对话框,如“您的PC不支持VT-x技术”

如果您正在运行Linux,则需要安装KVM。 在这里您可以找到如何操作的说明: https//software.intel.com/zh-cn/blogs/2012/03/12/how-to-start-intel-hardware-assisted-virtualization-hypervisor-on- Linux到加速,Intel的Android系统的x86架构模拟器

检查Hyper-V是否正在运行(仅限Windows)

如果您正在使用Windows,请选中此选项并禁用Hyper-V(如果已启用)

之后尝试再次安装HAXM/KVM

希望它有所帮助


I think that your computer is not compatible with VT-x/HAXM technology or you haven't already installed.

Open your Android Sdk manager.

  1. Go to your android-sdk directory and choose tools folder.
  2. Run android file.
  3. Check if HAXM is installed

enter image description here

If it isn't installed try to install and check if it would show error dialog like 'your PC doesn't support VT-x technology'

If you're running Linux, you would need to install KVM. Here you would find instruction how to do it: https://software.intel.com/en-us/blogs/2012/03/12/how-to-start-intel-hardware-assisted-virtualization-hypervisor-on-linux-to-speed-up-intel-android-x86-emulator

Check if Hyper-V is running (only Windows)

If you're using Windows check this and DISABLE Hyper-V if it is enabled

After that try to install HAXM/KVM again.

Hope it help

相关问答

更多
  • 模拟器上的Honeycomb图像非常慢。 这些3.0平板电脑正在运行Tegra2并且仿真器的性能表明了原因。 除非您需要专门测试Honeycomb的功能,否则我建议您在运行10级或更早版本的仿真器映像上开发和测试您的应用程序。 The Honeycomb image on the emulator is really^4 slow. There's a reason these 3.0 tablets are running a Tegra2 and the performance of the emula ...
  • 你在Mac上也有这个选项,它与Windows没有什么不同: You have this option on mac too, it's not that different from Windows:
  • 您可以使用VirtualBox设置Android虚拟机: http://www.howtogeek.com/164570/how-to-install-android-in-virtualbox/ 并部署到虚拟盒: eclipse中虚拟盒子上的android模拟 我曾经尝试了一段时间,这是一个相当大的性能提升差异。 我有一段时间没有这样做,因为我买了一个非常高端的手机,我现在就用它。 You can setup an Android Virtual Machine using VirtualBox : ht ...
  • 重启Eclipse会对你有所帮助! Restarting Eclipse will help you!
  • 从Android SDK管理器下载该级别的sdk级别和模拟器。 如果sdk设置正确,只需在命令提示符下键入android ,它就会显示出来。 Download that sdk level and emulators for the level from the Android SDK manager. If the sdk is set up properly, simply type android in the command prompt and it should show up.
  • 我认为您的计算机与VT-x/HAXM技术不兼容,或者您尚未安装。 打开Android Sdk管理器。 转到android-sdk目录并选择tools文件夹。 运行android文件。 检查是否安装了HAXM 如果未安装,请尝试安装并检查是否显示错误对话框,如“您的PC不支持VT-x技术” 如果您正在运行Linux,则需要安装KVM。 在这里您可以找到如何操作的说明: https : //software.intel.com/zh-cn/blogs/2012/03/12/how-to-start-intel- ...
  • 尝试启动应用程序后,您的模拟器运行了多长时间? Android操作系统可能需要很长时间才能在模拟器中启动。 如果它停留在“ANDROID”屏幕上,那么你要么没有等待足够长的时间,要么你的模拟器出了问题。 它最终应该像设备一样启动到普通的Android锁屏或主屏幕。 您可以在尝试运行应用程序之前启动模拟器,方法是打开Android虚拟设备管理器(Eclipse中的工具栏图标,如果安装正确),然后选择模拟器并单击“开始”按钮。 如果您没有列出任何模拟器,则需要通过单击“新建...”按钮创建一个模拟器。 How ...
  • 重新安装Windows解决了这个问题。 Reinstallation of Windows solved the problem.
  • Android没有正式支持Java 7,尽管在这种情况下这不太可能是你的问题。 我建议选择正常的屏幕分辨率,看看是否有帮助。 我不知道任何具有640x640分辨率的生产设备。 Android does not officially support Java 7, though that unlikely to be your problem in this case. I would recommend choosing a normal screen resolution and see if that ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)