Home  >  Q&A  >  body text

TP5.0 How to update the variable values ​​in the interface template without refreshing

I am a beginner and want to add a search function to a data list. I just click the search button and use the returned results to directly assign values ​​to the original data list

2313 days ago1146

reply all(2)I'll reply

  • 落寞尘埃

    落寞尘埃2018-07-13 10:57:06

    There are two solutions

    1. Use ajax technology to get the variables from the background, and then reassign them to the template

    2. Predefine the variable array in js. When you click the search button , change the variable value in the template

    reply
    0
  • 

    Thanks for the advice

    · 2018-07-13 11:39:32
  • 无忌哥哥

    无忌哥哥2018-07-12 17:52:44

    Use ajax to send request data, which is the content you want to search. When ajax returns, use jquery to dynamically insert data. This is my idea.

    reply
    0
  • Cancelreply