Hi.
I have jQGrid. Some of columns are edittype:”select”.
<pre class=”default prettyprint prettyprinted”><span class="pun">{</span><span class="pln">label</span><span class="pun">:</span><span class="str">"Student"</span><span class="pun">,</span><span class="pln">name</span><span class="pun">:</span><span class="str">"student_id"</span><span class="pun">,</span><span class="pln">index</span><span class="pun">:</span><span class="str">"student_id"</span><span class="pun">,</span><span class="pln">editable</span><span class="pun">:</span><span class="kwd">true</span><span class="pun">,</span><span class="pln">edittype</span><span class="pun">:</span><span class="str">"select"</span><span class="pun">,</span><span class="pln">editoptions</span><span class="pun">:{</span><span class="pln">dataUrl</span><span class="pun">:</span><span class="str">"../ajax/selects/select_student.php"</span><span class="pun">}}
In my project the number of elements in selects become huge and this lead to usability drawbacks. I want to make selects in add/edit form more intelligent. For this purpose i try to use "chosen" plugin. So, i try this:
</span>
<pre class=”default prettyprint prettyprinted”><span class="pln">beforeShowForm</span><span class="pun">:</span> <span class="kwd">function</span><span class="pun">()</span> <span class="pun">{</span><span class="pln">
$</span><span class="pun">(</span><span class="str">"#student_id"</span><span class="pun">).</span><span class="pln">chosen</span><span class="pun">();</span>
<span class="pun">}
</span>
In this example “student_id” is the id of select element on add/edit form.
But no effect. Select stay as usual select. Chosen functionality is not added.
Than I try this:
editoptions:{
dataUrl:”…”,
selectFilled:function(){
$(“#student_id”).chosen();
}
}
But still no liuck.
How can I have “chosen” to work on add/edit form for select elements?
<pre class=”default prettyprint prettyprinted”><span class="pun"> </span>
<pre class=”default prettyprint prettyprinted”><span class="pun">
</span>
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top