Permalink
Browse files

fix: pro-IUAPDESIGN-75:云表单:gird增加landLine、phoneNumber

  • Loading branch information...
1 parent 0aaa6a4 commit 77fa990349648290219c3ac401e18bcd57b0e479 @whizbz11 whizbz11 committed Oct 31, 2016
Showing with 25 additions and 1 deletion.
  1. +25 −1 js/component/keroa-grid.js
@@ -131,7 +131,7 @@ var GridAdapter = BaseAdapter.extend({
eType = 'string';
if(eType == 'number') // 兼容之前版本
eType = 'integer';
- if(eType == 'string' || eType == 'integer' || eType == 'checkbox' || eType == 'combo' || eType == 'radio' || eType == 'float' || eType == 'currency' || eType == 'datetime'|| eType == 'year'|| eType == 'month'|| eType == 'yearmonth'|| eType == 'date' || eType == 'time' || eType == 'url' || eType == 'password' || eType == 'percent'){
+ if(eType == 'string' || eType == 'integer' || eType == 'checkbox' || eType == 'combo' || eType == 'radio' || eType == 'float' || eType == 'currency' || eType == 'datetime'|| eType == 'year'|| eType == 'month'|| eType == 'yearmonth'|| eType == 'date' || eType == 'time' || eType == 'url' || eType == 'password' || eType == 'percent' || eType == 'phoneNumber' || eType == 'landLine'){
oThis.createDefaultEdit(eType,eOptions,options,viewModel,column);
column.editType = function(obj){
if(oThis.editComponentDiv[column.field] && oThis.editComponentDiv[column.field][0].childNodes.length > 0){
@@ -147,6 +147,8 @@ var GridAdapter = BaseAdapter.extend({
obj.element.innerHTML = '';
var row = oThis.getDataTableRow(obj.rowObj)
$(obj.element).append(oThis.editComponentDiv[column.field]);
+
+
if(comp.required) {
$(obj.element).parent().parent().find('.u-grid-edit-mustFlag').show()
}
@@ -1490,6 +1492,28 @@ var GridAdapter = BaseAdapter.extend({
options:eOptions,
model: viewModel
});
+ } else if (eType == 'phoneNumber') {
+ compDiv = $('<div ><input type="text" class="u-input"></div>');
+ if (!options.editType || options.editType == "default") {
+ compDiv.addClass("eType-input");
+ }
+ eOptions.dataType = 'phoneNumber';
+ comp = new u.PhoneNumberAdapter({
+ el: compDiv[0],
+ options: eOptions,
+ model: viewModel
+ });
+ } else if (eType == 'landLine') {
+ compDiv = $('<div ><input type="text" class="u-input"></div>');
+ if (!options.editType || options.editType == "default") {
+ compDiv.addClass("eType-input");
+ }
+ eOptions.dataType = 'landLine';
+ comp = new u.LandLineAdapter({
+ el: compDiv[0],
+ options: eOptions,
+ model: viewModel
+ });
}
if (comp && comp.dataAdapter){

0 comments on commit 77fa990

Please sign in to comment.