合金1.8.3升级后的转换问题/可能的新bug?

时间:2016-03-29 15:24:47

标签: appcelerator appcelerator-alloy

我发现有2个与Alloy升级到1.8.3有关的问题, 我认为两者都是关于转换和数据绑定的另一个bug的一部分,https://jira.appcelerator.org/browse/ALOY-1477

我不想仅仅将其报告为一个错误,因为它会影响到我正在做的事情吗?

第一个,我最初在变换中引用了merge_id作为列表 但是这开始产生了一个错误,说找不到alloy_id,把它改成$ model的工作,但不确定那是我们现在应该怎么做的还是上面的bug的一部分?

xml代码(部分)

<TableViewRow id="categoriesRow" UCATID="{UCATID}" 
            ParentID="{ParentID}" CategoryID="{CategoryID}" catName=    {catName}" 
            model="$model" hasDetail="{hasDetail}">
        <!-- TableViewRow id="categoriesRow" UCATID="{UCATID}" 
            ParentID="{ParentID}" CategoryID="{CategoryID}" catName="{catName}" 
            model="{alloy_id}" hasDetail="{hasChildren}"-->
            <Label id="rowTitle">{CategoryName}</Label>
        </TableViewRow>

第二个是将hasDetail设置为true或false(布尔值)表格行以显示更多细节,这适用于iOS应用程序,通过在所有版本中显示小图标到目前为止, 但是在升级之前,将引用验证为布尔值有效,但现在必须将其作为字符串引用 这不对吗?

controller.js代码

function transformFunction(model) {
   var transform = model.toJSON();
   transform.catName = transform.CategoryName;
   transform.hasDetail = transform.hasChildren == "0" ? false : true;
   return transform;
}

$.winProdCats.addEventListener('click', function(e) {
   Ti.API.info('e.row.hasDetail: ' + e.row.hasDetail );
   var iHaveBoolean = e.row.hasDetail;
   Ti.API.info('iHaveBoolean: ' + iHaveBoolean );
  //if(e.row.hasDetail){ //this don't work as a boolean anymore only as a string
    if(iHaveBoolean == "true"){
      parentID = e.row.CategoryID;
      getData();
      filterFunction(library);
      updateUI();
    } else {
      Ti.App.fireEvent('app:products:category:selected', {
          UCATID : e.row.UCATID,
          catName : e.row.catName,
          ParentID : e.row.ParentID,
          CategoryID : e.row.CategoryID
      });
      Alloy.Globals.navGroup.closeWindow($.winProdCats);
    }
});

1 个答案:

答案 0 :(得分:0)

  

无法找到Alloy_id的错误

这是ALOY-1477,已在Alloy 1.8.4中修复

  

//if(e.row.hasDetail){ //this don't work as a boolean anymore only as a string

这是ALOY-1480,修复将于下周合并为Alloy 1.8.x,并于4月底发布AppC CLI 5.3.0

相关问题