如何将值从实体设置为Dropdown。

编程入门 行业动态 更新时间:2024-10-26 06:29:36
本文介绍了如何将值从实体设置为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。

本文发布于:2023-11-12 01:28:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580125.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:设置为   如何将   实体   Dropdown

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!