起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3186|回复: 15

[结贴] 绑定data组件不显示

[复制链接]

66

主题

254

帖子

682

积分

高级会员

Rank: 4

积分
682
QQ
发表于 2017-2-15 11:41:55 | 显示全部楼层 |阅读模式
我做的页面绑定data组件在页面上不显示

<?xml version="1.0" encoding="utf-8"?>
<div xmlns="http://www.w3.org/1999/xhtml" component="$UI/system/components/justep/window/window" design="device:m;" xid="window" class="window">  
  <div component="$UI/system/components/justep/model/model" xid="model" style="height:auto;top:18px;left:502px;">
  <div component="$UI/system/components/justep/data/data" autoLoad="true" xid="titleData" idColumn="FEXAMSID"><column label="试题ID" name="FEXAMSID" type="Integer" xid="xid1"></column>
  <column label="类别" name="FClassBID" type="String" xid="xid2"></column>
  <column label="问题" name="FQuestion" type="String" xid="xid3"></column>
  <column label="答案" name="FAnswer" type="String" xid="xid4"></column>
  <column label="分值" name="FScore" type="Integer" xid="xid5"></column>
  <column label="难度等级" name="FLevelid" type="String" xid="xid6"></column>
  <column label="状态" name="FState" type="String" xid="xid13"></column>
  <column label="题型" name="FSortID" type="String" xid="xid7"></column>
  <column label="选项一" name="FOne" type="String" xid="xid8"></column>
  <column label="选项二" name="FTwo" type="String" xid="xid9"></column>
  <column label="选项三" name="FThree" type="String" xid="xid10"></column>
  <column label="选项四" name="FFour" type="String" xid="xid11"></column>
  <column label="问题解析" name="FWtJX" type="String" xid="xid12"></column>
  <column label="备用A" name="FMarkA" type="String" xid="xid14"></column>
  <column label="备用B" name="FMarkB" type="String" xid="xid15"></column>
  <column label="备用C" name="FMarkC" type="String" xid="xid16"></column>
  <column label="FCORPID" name="FCORPID" type="String" xid="xid17"></column>
  <column label="最后操作人" name="FLastMan" type="String" xid="xid18"></column>
  <column label="最后操作时间" name="FLastTime" type="DateTime" xid="xid19"></column>
  <column label="出题人" name="FirstMan" type="String" xid="xid20"></column>
  <column label="出题时间" name="FirstTime" type="DateTime" xid="xid21"></column></div><div component="$UI/system/components/justep/data/data" autoLoad="true" xid="questionData" idColumn="question"><column label="ID" name="ID" type="Integer" xid="xid22"></column>
  <column label="答案" name="question" type="String" xid="xid23"></column></div>
  </div>  
  <div component="$UI/system/components/justep/panel/panel"
    class="x-panel x-full" xid="panel1">
      <div class="x-panel-top" xid="top1">
        <div component="$UI/system/components/justep/titleBar/titleBar" class="x-titlebar" title="试卷">
          <div class="x-titlebar-left">
            <a component="$UI/system/components/justep/button/button"
              label="" class="btn btn-link btn-only-icon" icon="icon-chevron-left"
              xid="backBtn">
              <i class="icon-chevron-left"/>  
              <span></span>
            </a>
          </div>  
          <div class="x-titlebar-title">试卷</div>  
          <div class="x-titlebar-right reverse">
          </div>
        </div>
      </div>  
    <div class="x-panel-content x-bgImg" xid="content1">
  <div component="$UI/system/components/justep/row/row" class="x-row x-responsive-lg questions" xid="row2" style="width:453px;height:181px;">
   <div class="col col-xs-12" xid="col4"><div component="$UI/system/components/justep/labelEdit/labelEdit" class="x-label-edit x-label30" xid="labelEdit3" style="width:423px;">
   <label class="x-label" xid="label3" bind-text='$model.titleData.ref("FEXAMSID")' style="color:#FFFFFF;"></label>
   <div component="$UI/system/components/justep/output/output" class="x-output x-edit" xid="output3" bind-ref='$model.titleData.ref("FQuestion")' style="color:#FFFFFF;"></div></div></div>
   <div class=" col col-xs-12" xid="col5"><span component="$UI/system/components/justep/select/radioGroup" class="x-radio-group" xid="choose" bind-itemset="questionData" bind-itemsetValue='ref("ID")' bind-itemsetLabel='ref("question")'></span></div>
   <div class="col col-xs-12" xid="col6"><span xid="span4" bind-text=' $model.titleData.val("FAnswer") + $model.titleData.val("FWTJX")'></span>
  </div>
  <div class="x-col" xid="col1"><div component="$UI/system/components/justep/output/output" class="x-output" xid="output1" bind-ref='$model.titleData.ref("FEXAMSID")'></div>
  <div component="$UI/system/components/justep/output/output" class="x-output" xid="output2" bind-ref='$model.titleData.ref("FQuestion")'></div>
  </div></div>
  </div>
  <div class="x-panel-bottom" xid="bottom1"><div component="$UI/system/components/justep/button/buttonGroup" class="btn-group x-card btn-group-justified  x-bgImg" tabbed="true" xid="buttonGroup2"><a component="$UI/system/components/justep/button/button" class="btn " label="上一题" xid="preBtn">
   <i xid="i3"></i>
   <span xid="span5">上一题</span></a>
  <a component="$UI/system/components/justep/button/button" class="btn" label="下一题" xid="nextBtn">
   <i xid="i4"></i>
   <span xid="span6">下一题</span></a></div></div></div>
</div>


js代码
Model.prototype.titleDataCustomRefresh = function(event){
                var me = this;
               
                $.support.cors = true;
                $.ajax({
                        "async" : "true",
                        "url" : "http://192.168.1.119/OnlineSer.asmx/GetRemoteInterface",
                        "type" : "post",
                        "dataType" : "json",
                        // "contentType": 'application/json', 此处不能要
                        // "data": {"a":"2",
                        // "b":"3"},
                                "data" : {
                                        "sInterface" : "GetExamsQuestion",
//                                        // 序列化参数JSON字符串
                                        "sProcName" : "KS_GetExamsQuestion",
//                                        //"INparams" : options.INparams       
                                        "sParam" : "0|1|1|3|0|10"
                                },                               
                        "complete" : function(xhr) {
                                if (xhr.readyState == 4 && xhr.status == 200) {
                                       
                                         alert(xhr.responseText);
                                       
                                        var loadDatas = JSON.parse(xhr.responseText);
                                        loadDatas = loadDatas.Table;
                                        me.comp("titleData").loadData(loadDatas);
//                                        var ss = xhr.responseText;
//                                        console.log(ss.Table);
       

                                } else {
                                        alert("fail");
                                }
                        }

                });
               

        };



不要仰望别人,自己亦是风景

1

主题

6163

帖子

2095

积分

金牌会员

Rank: 6Rank: 6

积分
2095
QQ
发表于 2017-2-15 11:57:36 | 显示全部楼层
是动态添加  还是绑定不显示?
回复 支持 反对

使用道具 举报

发表于 2017-2-15 11:58:18 | 显示全部楼层
调试看下data.count()是多少??
确保data组件中是有数据的~!
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

66

主题

254

帖子

682

积分

高级会员

Rank: 4

积分
682
QQ
 楼主| 发表于 2017-2-15 12:42:49 | 显示全部楼层
半导体 发表于 2017-2-15 11:57
是动态添加  还是绑定不显示?

绑定的没有显示
不要仰望别人,自己亦是风景
回复 支持 反对

使用道具 举报

66

主题

254

帖子

682

积分

高级会员

Rank: 4

积分
682
QQ
 楼主| 发表于 2017-2-15 12:48:21 | 显示全部楼层
liangyongfei 发表于 2017-2-15 11:58
调试看下data.count()是多少??
确保data组件中是有数据的~!

有数据
不要仰望别人,自己亦是风景
回复 支持 反对

使用道具 举报

1

主题

6163

帖子

2095

积分

金牌会员

Rank: 6Rank: 6

积分
2095
QQ
发表于 2017-2-15 13:29:19 | 显示全部楼层

你的data的列名什么的和数据库的是一致的吗?

绑定的是不是没有获取到当前行啊  所以不显示  你咋绑定的发个截图看看
回复 支持 反对

使用道具 举报

66

主题

254

帖子

682

积分

高级会员

Rank: 4

积分
682
QQ
 楼主| 发表于 2017-2-15 13:46:07 | 显示全部楼层
半导体 发表于 2017-2-15 13:29
你的data的列名什么的和数据库的是一致的吗?

绑定的是不是没有获取到当前行啊  所以不显示  你咋绑定的 ...

QQ图片20170215134515.png
不要仰望别人,自己亦是风景
回复 支持 反对

使用道具 举报

66

主题

254

帖子

682

积分

高级会员

Rank: 4

积分
682
QQ
 楼主| 发表于 2017-2-15 13:51:36 | 显示全部楼层
就是这样写的
不要仰望别人,自己亦是风景
回复 支持 反对

使用道具 举报

1

主题

6163

帖子

2095

积分

金牌会员

Rank: 6Rank: 6

积分
2095
QQ
发表于 2017-2-15 13:52:16 | 显示全部楼层

data 里面就一条数据?

你绑定到bind-text上也不行吗?
回复 支持 反对

使用道具 举报

66

主题

254

帖子

682

积分

高级会员

Rank: 4

积分
682
QQ
 楼主| 发表于 2017-2-15 13:56:16 | 显示全部楼层
半导体 发表于 2017-2-15 13:52
data 里面就一条数据?

你绑定到bind-text上也不行吗?

两条数据,,,就是在那里面绑定的
不要仰望别人,自己亦是风景
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2025-6-30 10:41 , Processed in 0.062246 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表