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

auto_complete source by ajax #144

Closed
zxishere opened this issue Jan 15, 2015 · 2 comments
Closed

auto_complete source by ajax #144

zxishere opened this issue Jan 15, 2015 · 2 comments

Comments

@zxishere
Copy link

Is there way to set filter_type: "auto_complete" data source by ajax?

But i just soloved the problem by change some code:

            if (columnObj.filter_type === "auto_complete") {
                $("#yadcf-filter-" + table_selector_jq_friendly + "-" + column_number).autocomplete({
                    //source: $(document).data("yadcf-filter-" + table_selector_jq_friendly + "-" + column_number),
                    source: auto_complete_source,
                    select: autocompleteSelect
                });

insert some "auto_complete_source" span just like "text_data_delimiter" near

        text_data_delimiter,
        auto_complete_source,

        text_data_delimiter = columnObj.text_data_delimiter;
        auto_complete_source = columnObj.auto_complete_source;

Useage:
{column_number: 0,filter_type: "auto_complete", auto_complete_source:"{{ URL::to('admin/sites/auto-complete') }}"},

Excause for my poor english, Thank you all the same Daniel Reznick 👍

vedmack added a commit that referenced this issue Jan 29, 2015
auto_complete filter can accept an object to use it later in its constructor (for examplefor external ajax source)

#148
#144
@vedmack
Copy link
Owner

vedmack commented Jan 29, 2015

Hi,
Try using the filter_plugin_options , something like
filter_plugin_options: { source: "somePage.php" } or some more complex code like in http://jqueryui.com/autocomplete/#remote-jsonp example.

I haven't tried it myself so in case that it wont work please post a link to your page so I can debug it.

@vedmack vedmack closed this as completed Jan 29, 2015
@zxishere
Copy link
Author

Great ,it work!!!

vedmack added a commit that referenced this issue Jan 30, 2015
auto_complete filter can accept an object to use it later in its constructor (for examplefor external ajax source)

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

No branches or pull requests

2 participants