fastadmin禁用selectpage控件下拉选择

      发布在:前端技术      评论:0 条评论
<p><span style="color: rgb(26, 26, 26); font-family: &quot;Source Sans Pro&quot;, &quot;Helvetica Neue&quot;, Helvetica, &quot;Microsoft Yahei&quot;, Arial, sans-serif; background-color: rgb(239, 231, 195);">给</span>selectpage<span style="color: rgb(26, 26, 26); font-family: &quot;Source Sans Pro&quot;, &quot;Helvetica Neue&quot;, Helvetica, &quot;Microsoft Yahei&quot;, Arial, sans-serif; background-color: rgb(239, 231, 195);">设置data-select-only=&quot;true&quot;是不能输入,只有$(&#39;#selectPage&#39;).selectPageDisabled(true)不能点击下拉选择</span></p><p><span style="color: rgb(26, 26, 26); font-family: &quot;Source Sans Pro&quot;, &quot;Helvetica Neue&quot;, Helvetica, &quot;Microsoft Yahei&quot;, Arial, sans-serif; background-color: rgb(239, 231, 195);"></span></p><pre style="background-color:#262e37;color:#ffffff;font-family:&#39;Consolas&#39;,monospace;font-size:11.3pt;"><span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#660e7a;font-weight:bold;font-style:italic;">document</span>).<span style="color:#4ac60a;">on</span>(<span style="color:#e6db74;">&quot;change&quot;</span>, <span style="color:#e6db74;">&quot;#c-modelname&quot;</span>, <span style="color:#f92672;">function </span>() {<br/> <span style="color:#f92672;">var </span><span style="color:#64a2a2;">value </span><span style="color:#f92672;">= </span><span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#f92672;">this</span>).<span style="color:#4ac60a;">val</span>() <span style="color:#f92672;">== </span><span style="color:#e6db74;">&quot;common&quot; </span><span style="color:#f92672;">? </span><span style="color:#e6db74;">&quot;&quot; </span><span style="color:#f92672;">: </span><span style="color:#e6db74;">&quot;_&quot; </span><span style="color:#f92672;">+ </span><span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#f92672;">this</span>).<span style="color:#4ac60a;">val</span>();<br/> <span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#e6db74;">&quot;#c-channeltpl&quot;</span>).<span style="color:#4ac60a;">val</span>(<span style="color:#e6db74;">&quot;channel&quot; </span><span style="color:#f92672;">+ </span><span style="color:#64a2a2;">value </span><span style="color:#f92672;">+ </span><span style="color:#e6db74;">&quot;.html&quot;</span>).<span style="color:#4ac60a;">selectPageRefresh</span>();<br/> <span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#e6db74;">&quot;#c-listtpl&quot;</span>).<span style="color:#4ac60a;">val</span>(<span style="color:#e6db74;">&quot;list&quot; </span><span style="color:#f92672;">+ </span><span style="color:#64a2a2;">value </span><span style="color:#f92672;">+ </span><span style="color:#e6db74;">&quot;.html&quot;</span>).<span style="color:#4ac60a;">selectPageRefresh</span>();<br/> <span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#e6db74;">&quot;#c-showtpl&quot;</span>).<span style="color:#4ac60a;">val</span>(<span style="color:#e6db74;">&quot;show&quot; </span><span style="color:#f92672;">+ </span><span style="color:#64a2a2;">value </span><span style="color:#f92672;">+ </span><span style="color:#e6db74;">&quot;.html&quot;</span>).<span style="color:#4ac60a;">selectPageRefresh</span>();<br/> <span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#e6db74;">&quot;#c-channeltpl,#c-listtpl,#c-showtpl&quot;</span>).<span style="color:#4ac60a;">selectPageDisabled</span>(<span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#f92672;">this</span>).<span style="color:#4ac60a;">val</span>() <span style="color:#f92672;">!== </span><span style="color:#e6db74;">&quot;&quot;</span>);<br/>});<br/><span style="color:#64a2a2;">Controller</span>.<span style="color:#660e7a;font-weight:bold;">api</span>.<span style="color:#4ac60a;">bindevent</span>();</pre><p><span style="color: rgb(26, 26, 26); font-family: &quot;Source Sans Pro&quot;, &quot;Helvetica Neue&quot;, Helvetica, &quot;Microsoft Yahei&quot;, Arial, sans-serif; background-color: rgb(239, 231, 195);"></span>于是想到了其他的处理方式</p><pre style="background-color:#262e37;color:#ffffff;font-family:&#39;Consolas&#39;,monospace;font-size:11.3pt;"><span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#660e7a;font-weight:bold;font-style:italic;">document</span>).<span style="color:#4ac60a;">on</span>(<span style="color:#e6db74;">&quot;change&quot;</span>, <span style="color:#e6db74;">&quot;.selectpage&quot;</span>, <span style="color:#f92672;">function </span>() {<br/> <span style="color:#fd971f;font-style:italic;">$</span>(<span style="color:#e6db74;">&#39;.</span><span style="color:#a6e22e;">selectpage</span><span style="color:#e6db74;">[</span><span style="color:#a6e22e;">readonly</span><span style="color:#e6db74;">=&quot;readonly&quot;]&#39;</span>).<span style="color:#4ac60a;">selectPageDisabled</span>(<span style="color:#f92672;">true</span>);<br/>});</pre><p><span style="color: rgb(26, 26, 26); font-family: &quot;Source Sans Pro&quot;, &quot;Helvetica Neue&quot;, Helvetica, &quot;Microsoft Yahei&quot;, Arial, sans-serif; background-color: rgb(239, 231, 195);"><br/></span></p><p><span style="color: rgb(26, 26, 26); font-family: &quot;Source Sans Pro&quot;, &quot;Helvetica Neue&quot;, Helvetica, &quot;Microsoft Yahei&quot;, Arial, sans-serif; background-color: rgb(239, 231, 195);"><br/></span></p>
相关文章
热门推荐