如何将值从实体设置为Dropdown。 [英] how to set the value from entity to Dropdown.

查看:80
本文介绍了如何将值从实体设置为Dropdown。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone,



i在我的项目中有一个实体结构。在实体中我有多少属性。

我正在使用我的代码中的jquery。我在FiletypeList中获取值。在filetypeList中我有K2FileTypeProperties。我想设置FileTypeDropdown.Drop中K2Filetypeproperties中存在的值Down Down如下:

Hello Everyone,

i have an entity structure in my project.In Entity i have the number of properties.
I am using jquery in my Code .I am getting the value in FiletypeList.In filetypeList i have the K2FileTypeProperties .i want to set the value which is present in K2Filetypeproperties in FileTypeDropdown.Drop Down As follows:

<div class="input-append">
                <label>
                    File Type :</label>
                <select id="fileTypeSelect" class="combo150">
                </select>
            </div>

Please find the Given Code:
var fileTypeList = [];
        function GetFileTypeList() {
            debugger;
            $.ajax({
                url: 'FileLog.aspx/GetFileTypeList',
                type: 'POST',
                contentType: 'application/json; charset=utf-8',
                dataType: "json",
                success: function (result) {
                    if (result.d != '') {
                        debugger;
                        if (result.d != '' && result.d != null) {
                            fileTypeList = JSON.parse(result.d);
                            if (fileTypeList != '' && fileTypeList != null) {
                                $('#fileTypeSelect').val(fileTypeList.K2FileType); ////here it shows me undefined
                            }
                        }
                        //alert(result.d);
                        manageOverlay(false);
                    }
                },
                error: function (error) {
                    manageOverlay(false);
                    alert(error.responseText);
                },
                async: false

            })
        };

推荐答案

.ajax({
url:'FileLog.aspx / GetFileTypeList',
type:'POST',
contentType:'application / json; charset = utf-8',
dataType:json,
成功:函数(结果){
if(result.d!=''){
debugger;
if(result.d !=''&& result.d!= null){
fileTypeList = JSON.parse(result.d);
if(fileTypeList!=''&& fileTypeList!= null ){
.ajax({ url: 'FileLog.aspx/GetFileTypeList', type: 'POST', contentType: 'application/json; charset=utf-8', dataType: "json", success: function (result) { if (result.d != '') { debugger; if (result.d != '' && result.d != null) { fileTypeList = JSON.parse(result.d); if (fileTypeList != '' && fileTypeList != null) {


('#fileTypeSelect')。val(fileTypeList.K2FileType); ////这里显示未定义
}
}
//alert(result.d);
mana geOverlay(假);
}
},
错误:函数(错误){
manageOverlay(false);
alert(error.responseText);
},
async:false

})
};
('#fileTypeSelect').val(fileTypeList.K2FileType); ////here it shows me undefined } } //alert(result.d); manageOverlay(false); } }, error: function (error) { manageOverlay(false); alert(error.responseText); }, async: false }) };


大家好,

最后我得到了解决方案。

Hi Everyone ,
Finally I got the Solution.
var fileTypeList = [];
function GetFileTypeList() {
    debugger;


这篇关于如何将值从实体设置为Dropdown。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆