Giter Club home page Giter Club logo

Comments (6)

lekoala avatar lekoala commented on September 28, 2024

if you pull the list live from the server, you can serve the newly created option no?

from bootstrap5-tags.

jordanyeo avatar jordanyeo commented on September 28, 2024

If I use live-server, it works as far as returning most up to date list of existing tags, but on pageload I don't have any of my pre-selected options rendered.

from bootstrap5-tags.

lekoala avatar lekoala commented on September 28, 2024

adding selected options works like this

bootstrap5-tags/demo.html

Lines 927 to 932 in 3869ab8

<label for="liveInitialValue" class="form-label">Tags (live server side + initial value)</label>
<select class="form-select" id="liveInitialValue" name="tags_live_initial[]" multiple data-allow-new="true"
data-server="demo.json" data-live-server="1" data-items='{"some": "some", "value": "value"}' data-selected="some,value"
data-server-params='{"key":"val"}'>
<option disabled hidden value="">Choose a tag...</option>
</select>

from bootstrap5-tags.

jordanyeo avatar jordanyeo commented on September 28, 2024

Gotcha- so data-items needs to list all the possible options that were available at pageload?

from bootstrap5-tags.

lekoala avatar lekoala commented on September 28, 2024

yes!
it also work by simply adding regular options, i've tried this here

bootstrap5-tags/demo.html

Lines 937 to 944 in 6bf074c

<label for="liveInitialValueHtml" class="form-label">Tags (live server side + initial value from html)</label>
<select class="form-select" id="liveInitialValue" name="tags_live_initial[]" multiple data-allow-new="true"
data-server="demo.json" data-live-server="1"
data-server-params='{"key":"val"}'>
<option disabled hidden value="">Choose a tag...</option>
<option value="some" selected="selected">some</option>
<option value="value" selected="selected">value</option>
</select>

from bootstrap5-tags.

jordanyeo avatar jordanyeo commented on September 28, 2024

Got it working now, thanks so much! Very greatly appreciated!! :)

from bootstrap5-tags.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.