coolair
V2EX  ›  问与答

Select2 ajax 获取数据的时候如何使得 option 的 value 为 text 的值而不是 id 的值呢?

  •  
  •   coolair · Apr 18, 2017 · 2752 views
    This topic created in 3339 days ago, the information mentioned may be changed or developed.
    3 replies    2018-01-09 11:42:26 +08:00
    JerryZhang
        1
    JerryZhang  
       Apr 18, 2017
    API 返回值中的 id 填为 text 不就行了吗?
    coolair
        2
    coolair  
    OP
       Apr 18, 2017
    @JerryZhang API 是别人的改不了呀。
    JerryZhang
        3
    JerryZhang  
       Jan 9, 2018
    @coolair 可以改的,你仔细阅读文档。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3987 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 04:15 · PVG 12:15 · LAX 21:15 · JFK 00:15
    ♥ Do have faith in what you're doing.