Select advanced load remote data

Support General Select advanced load remote data

  • This topic has 6 replies, 4 voices, and was last updated 6 years ago by eazyeazy.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4956
    JackkyJackky
    Participant

    I want to make simular to https://select2.github.io/examples.html#data-ajax with js_options option. How I can do this?

    #4957
    JackkyJackky
    Participant

    Also I have realised, that I can make this with custom_html callback. But maybe it can be good idea, to make opportunity to use select_advanced?

    #4960
    Anh TranAnh Tran
    Keymaster

    Hi Jackky,

    Thanks for the idea. It's a good idea. We haven't implemented that feature yet in the plugin. I'll try that 🙂

    #11317
    Anh TranAnh Tran
    Keymaster

    Hello guys,

    Finally, I got something that works:

    Please checkout the select2-ajax branch and see the demo file here.

    #12558
    Aqib AshefAqib Ashef
    Participant

    Is it part of the main release branch that is available at wp.org?

    #12567
    Anh TranAnh Tran
    Keymaster

    Hi Aqib,

    It's not available on .org yet. I need to improve it a little bit. At the moment, it's very basic.

    #14478
    eazyeazy
    Participant

    Hello, is there any news about this feature?

    Can't you make some wrapper function (where you can pass and array of parameters) for ajax_callback that uses search feature of:

    wp-admin/edit.php?s=test&post_status=all&post_type=post&action=-1&m=0&cat=0&paged=1&action2=-1

    the get parameters of this search is the array i said before, the search will return an array of [post_id , post_title], if found any, and will be used as select option.
    You can also trigger the search when a minimum of words is typed, or just add some button.

    test_initial_callback can be just the load of the field, if any value is found on database, for sure this is way better than loading an select with all possible options and populating the html.

    I think you can do this and merge the feature on live (i think even something basic is appreciated by anyone)

    I'd like to help you, but xdebug on wordpress/windows is not working, also i work mainly on Magento, and neved did something complicated on wordpress.

    Personally I'd like to see this feature on post_relation plugin.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.