如何使用数据库中的记录来填充jquery multiselect插件 [英] How to populate jquery multiselect plugin with two sides with records from database

查看:80
本文介绍了如何使用数据库中的记录来填充jquery multiselect插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上看到了这个插件。它使我能够从一侧添加选定的文本,然后将其添加到另一侧。我已经在我的项目中很好地集成了它,但我很乐意在我的数据库中显示表格中的文本。下面是我添加到其中的一些文本的定义,但希望从我的数据库中填充此文本,因为它们可以随时更改。我正在使用的jquery插件是pickList插件。我有一个想法,我需要使用Ajax来实现这一点,但我还需要更多的解释和指导











I came across this plugin online. It enables me to add a selected text from one side and then add it to another side. I have intergrated it well in my project but i would love to display the text from my table in my database. Below is the definition of some of the text i have added to it but want this text to be populated from my database since they can change at anytime. The jquery plugin i'm using is pickList plugin. I do have an idea that i would need to make use of Ajax to achieve this but i still need a bit more explanation and guide





var val = {
                 01: { id:01, text: 'HYGEIA HMO LIMITED ' },
                 02: { id:02, text: 'TOTAL HEALTH TRUST LIMITED' },
                 03: { id:03, text: 'CLEARLINE INTERNATIONAL LIMITED' },
};
 var pick = $("#pickList").pickList({ data: val });







这里只是一个简单的示例代码。如果您之前使用过此插件或类似的东西,并且能够从db填充文本,请提供一个洞察力。谢谢。无论如何我正在使用asp.net



我尝试过:



i只试图将每个文本写入pickList。我只需要一个headstart或提示




Here is just a simple of sample code. If you have used this plugin before or something similar and has been able to populate the text from db, kindly give an insight. Thanks. I'm using asp.net anyway

What I have tried:

i have only tried to write each text to the pickList. I just need a headstart or hint

推荐答案

(#pickList)。pickList({data:val});
("#pickList").pickList({ data: val });







这里只是一个简单的示例代码。如果您之前使用过此插件或类似的东西,并且能够从db填充文本,请提供一个洞察力。谢谢。无论如何我正在使用asp.net



我尝试过:



i只试图将每个文本写入pickList。我只需要一个headstart或提示




Here is just a simple of sample code. If you have used this plugin before or something similar and has been able to populate the text from db, kindly give an insight. Thanks. I'm using asp.net anyway

What I have tried:

i have only tried to write each text to the pickList. I just need a headstart or hint


这篇关于如何使用数据库中的记录来填充jquery multiselect插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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