How to use the select.all function in select

To help you get started, we’ve selected a few select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thx / magix-gallery / build / src / mx-tree / index.js View on Github external
var readOnly = (ops.readOnly + '') === 'true';
        var hasLine = (ops.hasLine + '') === 'true';
        var valueKey = ops.valueKey || 'value';
        var textKey = ops.textKey || 'text';
        var parentKey = ops.parentKey || 'pValue';
        // 是否需要全选功能,默认关闭
        var needAll = (ops.needAll + '') === 'true';
        // 是否可展开收起,默认false
        var needExpand = (ops.needExpand + '') === 'true';
        // 组织树状结构
        var info = Util.listToTree(ops.list, valueKey, parentKey);
        var list;
        if (needAll) {
            var all = {};
            all[valueKey] = me.id + '_all';
            all[textKey] = I18n['select.all'];
            all.isAll = true;
            all.children = info.list;
            list = [all];
        }
        else {
            list = info.list;
        }
        // 展开收起状态,默认false
        // 切换数据时保留历史展开收起状态
        var close = (ops.close + '') === 'true';
        var map = {};
        var _lp1 = function (arr) {
            arr.forEach(function (item) {
                map[item[valueKey]] = close;
                if (item.children && item.children.length > 0) {
                    _lp1(item.children);
github thx / magix-gallery / build / src / mx-dropdown / content.js View on Github external
parents.forEach(function (parent) {
            parent.list.forEach(function (item) {
                item.selected = (selectedValues.indexOf(item.value + '') > -1);
            });
        });
        this.updater.set({
            parents: parents,
            hasGroups: data.hasGroups,
            searchbox: data.searchbox,
            multiple: data.multiple,
            spm: data.spm,
            height: data.height,
            keyword: (data.keyword || ''),
            text: {
                search: I18n['dropdown.search'],
                select: I18n['select.all'],
                unselect: I18n['unselect.all'],
                submit: I18n['dialog.submit'],
                cancel: I18n['dialog.cancel'],
                empty: I18n['empty.text']
            }
        });
    },
    render: function () {
github thx / magix-gallery / dist / src / mx-dropdown / content.js View on Github external
parents.forEach(function (parent) {
            parent.list.forEach(function (item) {
                item.selected = (selectedValues.indexOf(item.value + '') > -1);
            });
        });
        this.updater.set({
            parents: parents,
            hasGroups: data.hasGroups,
            searchbox: data.searchbox,
            multiple: data.multiple,
            spm: data.spm,
            height: data.height,
            keyword: (data.keyword || ''),
            text: {
                search: I18n['dropdown.search'],
                select: I18n['select.all'],
                unselect: I18n['unselect.all'],
                submit: I18n['dialog.submit'],
                cancel: I18n['dialog.cancel'],
                empty: I18n['empty.text']
            }
        });
    },
    render: function () {
github thx / magix-gallery / tmpl / mx-dropdown / content.js View on Github external
parents.forEach(parent => {
            parent.list.forEach(item => {
                item.selected = (selectedValues.indexOf(item.value + '') > -1);
            })
        })
        this.updater.set({
            parents,
            hasGroups: data.hasGroups,
            searchbox: data.searchbox,
            multiple: data.multiple,
            spm: data.spm,
            height: data.height,
            keyword: (data.keyword || ''),
            text: {
                search: I18n['dropdown.search'],
                select: I18n['select.all'],
                unselect: I18n['unselect.all'],
                submit: I18n['dialog.submit'],
                cancel: I18n['dialog.cancel'],
                empty: I18n['empty.text']
            }
        })
    },
    render() {
github thx / magix-gallery / dist / src / mx-dropdown / multiple.js View on Github external
needAll: needAll,
            searchbox: searchbox,
            map: map,
            selected: selected,
            imme: selected,
            min: min,
            max: max,
            continuous: (ops.continuous + '' === 'true'),
            over: (count > 20),
            groups: groups,
            height: ops.height || 400,
            spm: me['@{owner.node}'].attr('data-spm-click') || '',
            placementClass: me['@{ui.placement}'],
            text: {
                search: I18n['dropdown.search'],
                select: I18n['select.all'],
                unselect: I18n['unselect.all'],
                submit: I18n['dialog.submit'],
                cancel: I18n['dialog.cancel'],
                empty: I18n['empty.text']
            }
        });
    },
    render: function () {
github thx / magix-gallery / build / src / mx-dropdown / multiple.js View on Github external
needAll: needAll,
            searchbox: searchbox,
            map: map,
            selected: selected,
            imme: selected,
            min: min,
            max: max,
            continuous: (ops.continuous + '' === 'true'),
            over: (count > 20),
            groups: groups,
            height: ops.height || 400,
            spm: me['@{owner.node}'].attr('data-spm-click') || '',
            placementClass: me['@{ui.placement}'],
            text: {
                search: I18n['dropdown.search'],
                select: I18n['select.all'],
                unselect: I18n['unselect.all'],
                submit: I18n['dialog.submit'],
                cancel: I18n['dialog.cancel'],
                empty: I18n['empty.text']
            }
        });
    },
    render: function () {

select

Programmatically select the text of a HTML element

MIT
Latest version published 8 years ago

Package Health Score

65 / 100
Full package analysis