This is a migrated thread and some comments may be shown as answers.

Hide MultiSelect control on editor template

3 Answers 552 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mike
Top achievements
Rank 1
mike asked on 12 Jun 2014, 06:32 PM
I have a template that has a multiselect control on it. I want to be able to hide it or show it dynamically.

  <script id="popup_editor" type="text/x-kendo-template">
<div id="monthlyOptions" >
      <label>Select Days of Month</label>
      <select id="daysOfMonth" name="daysOfMonth"  multiple="multiple" data-placeholder="Select Days"  data-role="multiselect">
          <option>1</option>
          <option>2</option>
          <option>3</option>
          <option>4</option>
          <option>5</option>
          <option>6</option>
          <option>7</option>
          <option>8</option>
          <option>9</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>
          <option>13</option>
          <option>14</option>
          <option>15</option>
          <option>16</option>
          <option>17</option>
          <option>18</option>
          <option>19</option>
          <option>20</option>
          <option>21</option>
          <option>22</option>
          <option>23</option>
          <option>24</option>
          <option>25</option>
          <option>26</option>
          <option>27</option>
          <option>28</option>
          <option>29</option>
          <option>30</option>
          <option>31</option>
      </select>
      <span class="k-invalid-msg" data-for="daysOfMonth"></span>
          </div>      </script>

How would i gain reference to this to call show/hide on it. Im doing something similar on a form and can call $("#daysOfMonth").hide() and it works fine. Doesn't work in the popup editor however. Any clues how to do this?

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 13 Jun 2014, 12:57 PM
Hello Mike,

Most probably the problem comes from the fact that you need to get the wrapping div and execute the hide() method on it. I have tested it in our online demo and it seems to work, please check the following screencast:

http://www.screencast.com/t/HSNC2AlscqB

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
mike
Top achievements
Rank 1
answered on 13 Jun 2014, 12:59 PM
Yes indeed. Grabbing the select itself just show/hides the underlying component.

Thank you!
0
Kiril Nikolov
Telerik team
answered on 13 Jun 2014, 01:31 PM
Hello Mike,

I am glad I helped.

In case you have any further questions, please do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
mike
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
mike
Top achievements
Rank 1
Share this question
or