Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何Ajax动态加载数据,在@后面输入字母或汉字后再刷新数据 #389

Open
Wing-Of-The-Guardian opened this issue Mar 21, 2016 · 3 comments

Comments

@Wing-Of-The-Guardian
Copy link

qq 20160321184204
qq 20160321184220
qq 20160321184234

@tolerious
Copy link

问题解决了么?

@minuux
Copy link

minuux commented Jan 4, 2017

var atwho_cache = {};
        $('#work').atwho({
            at: '@',
            displayTpl: "<li data-value='${empname}[${empnum}]'>${empname}[${empnum}]</li>",
            insertTpl: "@${empname}[${empnum}]",
            searchKey: "empname",
            limit: 7,
            callbacks: {
                remoteFilter: function (query, callback) {
                    if (atwho_cache[query] === undefined) {
                        $.getJSON(CFG.site_url + 'search/empinfo', {empname: query}, function (data) {
                            atwho_cache[query] = data;
                            callback(data);
                        });
                    } else {
                        callback(atwho_cache[query]);
                    }

                }
            }
        });

@wuxia510
Copy link

请问你的问题解决了吗?我看你的问题好像也是我现在遇到的问题。我需要实现输入汉字和输入拼音都能他暗处匹配的列表,现在只是输入汉字可以,输入拼音不行。不知道你解决没,能不能给我点建议!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants