HTML客户端中的数据绑定自定义控件组合框 [英] Databind Custom Control Combobox in HTML Client

查看:76
本文介绍了HTML客户端中的数据绑定自定义控件组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在HTML客户端中是否有人成功绑定了组合框自定义控件?

Has anyone had success with databinding a combobox custom control in the HTML client?

我正在使用Infragistics Ignite UI控件(除了:我强烈推荐它们,我是作为在HTML客户端中尝试过几个专有控件集(包括DXtreme,Kendo UI和Wijmo)的人说的.)

I am using Infragistics Ignite UI controls (aside: I highly recommend them, and I say this as someone who has experimented with several proprietary control sets in the HTML client, including DXtreme, Kendo UI, and Wijmo.)

对于combobox数据源,我将其中一个LightSwitch实体集转换为JSON数组,下面是一个示例:

For the combobox datasource, I transformed one of my LightSwitch entity sets into a JSON array, and here is an example:

var commonDiagnoses = [
       { "ID": 7, "DESCRIPTION": "Abdominal pain, unspecified site [789.00]", "ICD9CODE": "[789.00]", "SPECIALTY": "Symptoms", "COMMON": "TRUE" },  etc... ]

组合框控件呈现如下:

 $(element).append('<h4>Primary Diagnosis</h4><div id="comboTarget1"></div>');
    $("#comboTarget1").igCombo({
        dataSource: commonDiagnoses,
        valueKey: "ID",
        textKey: "DESCRIPTION",
        width: "375px",
        height: "40px",
        autoComplete: true
    });

按预期工作.

但是,在此之后,我尝试了Zlatkovsky的滑块数据绑定示例的一些变体,但没有成功:

But following this, I've tried some variations on Zlatkovsky's slider databinding example but without success:

setTimeout(function() {
    var $igCombo = $('div', $(element));
    contentItem.dataBind("stringValue", function (newValue) {
        $igCombo.val(newValue)
    });
  }, 0);


我还在Binder的博客文章中尝试了Binder的示例的一些变体,但无法成功绑定.成功的人有什么建议吗?


I also tried some variations on Binder's examples in his blog article but couldn't get successful binding.  Any suggestions from someone who's had success with this?

推荐答案

我还没有尝试使用igCombo,但这是基于您的代码的观察结果:

I have not tried using igCombo, but here are my observations based on your code:

    var


igCombo =
igCombo =


('div',


这篇关于HTML客户端中的数据绑定自定义控件组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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