xi/selector-bundle

关于此包的最新版本(dev-master)没有可用的许可证信息。

一个方便的用于与Symfony 2项目一起使用的选择器UI组件

安装: 453

依赖者: 0

建议者: 0

安全: 0

星标: 2

关注者: 1

分支: 2

开放问题: 0

语言:CoffeeScript

类型:symfony-bundle

dev-master 2013-04-17 07:56 UTC

This package is not auto-updated.

Last update: 2024-09-14 13:28:27 UTC


README

Selector bundle提供了一个方便的选择器UI组件,可以与Symfony 2项目一起使用。

依赖关系

xi-bundle-tag

安装

deps -file

[XiSelectorBundle]
    git=http://github.com/xi-project/xi-bundle-selector.git
    target=/bundles/Xi/Bundle/SelectorBundle

autoload.php 文件

<?php
'Xi\\Bundle'       => __DIR__.'/../vendor/bundles',
?>

appKernel.php -file

<?php
            new Xi\Bundle\SelectorBundle\XiSelectorBundle(),
 ?>

用法

您需要在主脚本文件中初始化选择器。

    options = {
        mainElement:            '.tag_item_selector',
        autoCompleteElement:    '.item_field', 
        containerElement:       '.items ul', 
        source:                 'URL TO SEARCH ACTION',     
        saveUrl:                'URL TO ADD ACTION',    
        selected:               selected,
        canAddNew:              true        # CAN YOU ADD NEW ITEM, OR JUST SELECT WHAT YOU HAVE SEARCHED.
        minLength:              3           # MIN TEXT LENGTH BEFORE SEARCH KICKS IN
    }
    yourSelector = new App.Selector(options)