Kendo UI Dropdownlist

此生再无相见时 提交于 2019-12-12 03:26:40

问题


Responseenter image description hereI have a kendo grid displaying ID,NID,SID(Student table) and some other fields.Now when i want to add new Student the NID field must me a dropdownlist populating the values from the database. How can we do this. What should be in the data-source . I wrote a query to get the NID. but how would i use it. Or is this wrong Thanks

<div>
    <table>
        <tr>
            <td>
                <div>
                    <label for="ID">ID</label>
                </div>
                <div data-container-for="data.ID">
                    <input id="id" data-bind="value: data.ID" style="width: 250px;" name="ID" type="text" />
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div>
                    <label for="NID" id="lcid">NID</label>
                </div>
                <div>
                    <input id="cid" />
                </div>
            </td>
            <td>
            </td>
        </tr>
    </table>
</div>

Service:

$(document).ready(function () {
    $("#cid").kendoDropDownList({
        dataTextField: "NID",
        dataValueField: "NID",
        dataSource: {
            transport: {
                read: {
                    dataType: "jsonp",
                    url: "/Services/getNID",
                }
            }
        }
    });
});

来源:https://stackoverflow.com/questions/35851695/kendo-ui-dropdownlist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!