Article From:https://segmentfault.com/q/1010000010224446
Question:

As the title suggests, Ajax requests a bunch of JSON strings, dynamically created into options, which are generally simple and achievable. But the front end of select uses layui, which has a method of encapsulation, and doesn’t know how to knead it with Ajax request.Dynamically add data together

Answer 0:

Today, we are also searching for this problem. We can not understand the rendering of the official. Only now do we know that it is necessary to put it in the asynchronous loading place.

Answer 1:

I rendered the value can not bind how to solve it?

Answer 2:

Why don’t you read the official documents carefully before using layui? It’s really thorough. Don’t be an extension party.

 form.on('select(test)', function (data) {//test The lay-filter attribute added to the selectConsole.log (data.elem); / / get select original DOM objectConsole.loG (data.value); / / get the selected valueConsole.log (data.othis); / / get beautified DOM objects.});

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *