in joomla 3 how to include auto complete search(在 joomla 3 中如何包含自动完成搜索)
问题描述
我正在创建自定义组件,其中正在使用自定义 fieldtype (mycomponent/models/fields/productcategory.php) 创建产品类别列表框. 它还在右侧显示了产品笼子方式.
I am creating custom component,in that In that am creating product category list box by using custom fieldtype (mycomponent/models/fields/productcategory.php). It also showing the product cagetory in right manner.
我需要创建选择列表框自动完成搜索像模块管理器中的位置字段..
i need to create select listbox with auto complete search like position field in module manager..
谁知道解决办法..
推荐答案
我已经使用 select.js.
I have solved my problem using select.js.
jQuery 编码是:
The jQuery coding is:
jQuery(document).ready(function($) {
jQuery(".productcat").change(function(){
fk_productcat = $("#" + this.id).val();
//alert(fk_productcat);
jQuery.ajax({
url:'index.php?option=com_gwerp&task=stocks.getListArticles',
type: "POST",
data: {
'fk_productcat': fk_productcat
}
}).done(function(msg) {
console.log(msg);
jQuery(".product").html(msg);
jQuery( ".product" ).val(msg).trigger( "liszt:updated" );
jQuery("#jform_fk_product_code").select2();
})
})
});
jQuery(document).ready(function() {
jQuery("#jform_fk_productcat").select2();
});
jQuery(document).ready(function() {
jQuery("#jform_fk_product_code").select2();
});
我通过参考this调用了Ajax文件网址.
这篇关于在 joomla 3 中如何包含自动完成搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 joomla 3 中如何包含自动完成搜索
基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何替换eregi() 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
