Note that there are some explanatory texts on larger screens.

plurals
  1. POKendo grid popup with Yes/No combo for boolean
    primarykey
    data
    text
    <p>This is driving me nuts. I am trying to do something that should be a no-brainer, but having loads of issues. I have two boolean fields that I want to bind to a combo box with Yes and No in it. I want to use the Kendo UI Combobox and I am doing all this in a popup template for a Kendo UI grid.</p> <p>In the code snippet bellow I have two selects (at the end of the template), one with the data-role="dropdownlist" set, the other without.</p> <p>The first select, ReceiveEmailMontlyFlyer, will select the correct value when you edit a user, but will not change the value it's supposed to be bound to. The second select, ReceiveEmailMessages, will not select the correct value or return the correct value.</p> <p>Please help. I must be missing something painfully simple, some rule about HTML 5 binding or Kendo that I don't know or understand.</p> <pre><code>&lt;script id="popupEditorTemplate" type="text/x-kendo-template"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="Username" class="required"&gt;Username&lt;/label&gt; &lt;/div&gt; &lt;input type="text" class="k-input k-textbox" name="Username" data-bind="value:Username"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="FirstName" class="required"&gt;First Name&lt;/label&gt; &lt;/div&gt; &lt;input type="text" class="k-input k-textbox" name="FirstName" data-bind="value:FirstName"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="LastName" class="required"&gt;Last Name&lt;/label&gt; &lt;/div&gt; &lt;input type="text" class="k-input k-textbox" name="LastName" data-bind="value:LastName"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="Email" class="required"&gt;Email&lt;/label&gt; &lt;/div&gt; &lt;input type="text" class="k-input k-textbox" name="Email" data-bind="value:Email"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="HomePhone"&gt;Home Phone&lt;/label&gt; &lt;/div&gt; &lt;input type="text" class="k-input k-textbox" name="HomePhone" data-bind="value:HomePhone"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="WorkPhone"&gt;Work Phone&lt;/label&gt; &lt;/div&gt; &lt;input type="text" class="k-input k-textbox" name="WorkPhone" data-bind="value:WorkPhone"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="MobilePhone"&gt;Mobile Phone&lt;/label&gt; &lt;/div&gt; &lt;input type="text" class="k-input k-textbox" name="MobilePhone" data-bind="value:MobilePhone"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="Line1" class="required"&gt;Address Line 1&lt;/label&gt; &lt;/div&gt; &lt;input type="text" class="k-input k-textbox" name="Line1" data-bind="value:Line1"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="Line2"&gt;Address Line 2&lt;/label&gt; &lt;/div&gt; &lt;input type="text" class="k-input k-textbox" name="Line2" data-bind="value:Line2"&gt; &lt;div class="k-edit-label"&gt; &lt;label for="ReceiveEmailMontlyFlyer"&gt;Receive Flyer&lt;/label&gt; &lt;/div&gt; &lt;select name="ReceiveEmailMontlyFlyer" id="ReceiveEmailMontlyFlyer" data-bind="value:ReceiveEmailMontlyFlyer"&gt; &lt;option value="1"&gt;Yes&lt;/option&gt; &lt;option value="0"&gt;No&lt;/option&gt; &lt;/select&gt; &lt;div class="k-edit-label"&gt; &lt;label for="ReceiveEmailMessages"&gt;Receive other&lt;/label&gt; &lt;/div&gt; &lt;select id="ReceiveEmailMessages" name="ReceiveEmailMessages" data-bind="value:ReceiveEmailMessages" data-role="dropdownlist"&gt; &lt;option value="1"&gt;Yes&lt;/option&gt; &lt;option value="0"&gt;No&lt;/option&gt; &lt;/select&gt; &lt;br /&gt; &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload