Autocomplete / tags and AJAX

Autocomplete / tags and AJAX

Loren MaxwellLoren Maxwell Posts: 409Questions: 100Answers: 10

Just a quick question / request -- any chance that the new (and wonderful) autocomplete and tags fields will eventually have the same AJAX capabilities as a regular AJAX request?

For example, the US state of Texas is divided into 254 counties.

Something like this would help get all the relevant counties from a table with all counties for every state in the US:

new DataTable.Editor({
    ajax: '/api/data',
    fields: [{
        label: 'Counties:',
        name: 'county',
        type: 'tags',
        ajax: {
            url: '/api/counties',
            data: {
                state: 'Texas'
            }
    }],
    // ...
})

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,831Questions: 1Answers: 10,518 Site admin

    Do you mean the ability to add extra information to the Ajax request, or provide the other options for it as an object (like ajax.data)?

    Allan

  • Loren MaxwellLoren Maxwell Posts: 409Questions: 100Answers: 10

    Yeah -- exactly like that. I think it would make a world of difference in terms of the flexibility on the backend.

  • Loren MaxwellLoren Maxwell Posts: 409Questions: 100Answers: 10

    Oh sorry -- I don't think I read your question correctly -- I meant like ajax.data.

  • allanallan Posts: 63,831Questions: 1Answers: 10,518 Site admin
    Answer ✓

    Good idea, thank you. I've got it on the list :).

    Allan

Sign In or Register to comment.