请选择 进入手机版 | 继续访问电脑版
 找回密码
 立即注册

QQ登录

只需一步,快速开始

FiringKing

注册会员

2

主题

5

帖子

51

积分

注册会员

积分
51

微信认证勋章

最新发帖
FiringKing
注册会员   /  发表于:2017-5-2 13:58  /   查看:4200  /  回复:6
flexgrid在这种情况下:1.页面:
<wj-flex-grid  control="sourceControl"
               items-source="datasource"
               beginning-Edit="beginEdit(s,e)"
               cell-Edit-Ended="endEdit(s,e)"
               is-read-only="false">
.......
  <wj-flex-grid-column header="币种" binding="currency" width="35">
     <wj-flex-grid-cell-template cell-type="CellEdit">
        <wj-combo-box items-source="currency_selectArr" selected-value="$value" is-editable="false"></wj-combo-box>
     </wj-flex-grid-cell-template>
  </wj-flex-grid-column>.......
</wj-flex-grid>

2.js文件:


$scope.currency_selectArr = ["RMB","USD"];
$scope.datasource= new wijmo.collections.CollectionView($scope.tableData);
注:$scope.tableData表里取出来的多条数据,为数组,有多个字段,其中有币种字段currency
3.操作:
通过获取  $scope.sourceControl.columnLayout 表格样式,成功保存到样式数据表里;然后,再次从数据表里取出保存的columnLayout 表格样式字段值,重新赋值回$scope.sourceControl.columnLayout后,<wj-combo-box >就无法下拉选择,变成了文本录入的input框了


求解决,谢谢!






6 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2017-5-2 17:07:42
沙发
您可以参考在线示例获取帮助:
http://demos.wijmo.com/5/Angular ... #/grid/columnLayout

如果是和在线示例一致还有问题,麻烦提供可以重现问题的Demo
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
FiringKing
注册会员   /  发表于:2017-5-2 18:57:37
板凳
Alice 发表于 2017-5-2 17:07
您可以参考在线示例获取帮助:
http://demos.wijmo.com/5/Angular/Explorer/Explorer/#/grid/columnLayout ...

你给的这个示例,同样是存在这个问题,点了保存,再重新加载保存的样式后,countryId就不能下拉选择了,变成了  input录入了
回复 使用道具 举报
FiringKing
注册会员   /  发表于:2017-5-3 14:25:25
地板
Alice 发表于 2017-5-2 17:07
您可以参考在线示例获取帮助:
http://demos.wijmo.com/5/Angular/Explorer/Explorer/#/grid/columnLayout ...

demo具体文件就不传了,代码很少的。具体代码如下:
1.html页面:
<div ng-app="app" ng-controller="appCtrl" class="container">
  <h1> AngularJS 下 Wijmo 5 的格式保存</h1>
  
  <br/>
  
  <wj-flex-grid items-source="data" control="sourceControl" is-read-only="false">
    <wj-flex-grid-column header="国家" binding="country"></wj-flex-grid-column>
    <wj-flex-grid-column header="币种" binding="currency">
        <wj-flex-grid-cell-template cell-type="CellEdit">
          <wj-combo-box items-source="currency_selectArr" selected-value="$value" is-editable="false"></wj-combo-box>
        </wj-flex-grid-cell-template>
    </wj-flex-grid-column>
    <wj-flex-grid-column header="销售额" binding="sales"></wj-flex-grid-column>
    <wj-flex-grid-column header="利润额" binding="expenses"></wj-flex-grid-column>
  </wj-flex-grid>
  
<br/>
<button ng-click="saveColumnLayout()">格式保存</button>
<button ng-click="loadColumnLayout()">格式载入</button>

</div>


2.js内容:

// define app, include Wijmo 5 directives
var app = angular.module('app', ['wj']);
// controller
app.controller('appCtrl', function($scope) {
        $scope.currency_selectArr = ["RMB","USD"];//币种下拉框取数
  // create some random data
  var countries = '英国,德国,美国,日本,意大利'.split(','),
    data = [];
  for (var i = 0; i < countries.length; i++) {
    data.push({
      country: countries,
      currency: i%2==1?"USD":"RMB",
      sales: Math.random() * 10000,
      expenses: Math.random() * 5000
    });
  };
  $scope.data = new wijmo.collections.CollectionView(data);
  //格式保存按钮
  $scope.saveColumnLayout = function() {
                  localStorage['columns'] = $scope.sourceControl.columnLayout;
        };
  //格式载入按钮
  $scope.loadColumnLayout = function() {
                  var columnLayout = localStorage['columns'];
      if (columnLayout) {
        $scope.sourceControl.columnLayout = columnLayout;
      }
        };

});


-----以上拷贝执行下,效果就是  先点格式保存,再点格式载入,币种那一整列编辑时就不能下拉框选择了
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-5-3 18:38:38
5#
问题明白了,combo-box 反序列化的时候没有加载出来,这个需要调研下,稍后给您答复。
回复 使用道具 举报
FiringKing
注册会员   /  发表于:2017-6-20 17:46:59
6#
dexteryao 发表于 2017-5-3 18:38
问题明白了,combo-box 反序列化的时候没有加载出来,这个需要调研下,稍后给您答复。

问一下,这个问题有处理吗?
回复 使用道具 举报
JeffryLI
葡萄城公司职员   /  发表于:2017-6-20 18:08:18
7#
您好,这个问题我帮您再问问,不好意思,请您谅解!
请点击评分,对我5分评价,谢谢!

葡萄城控件服务团队
官方网站: https://www.grapecity.com.cn/developer
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部