Skip to content

Commit

Permalink
fix: pro-IUAPDESIGN-75:云表单:gird增加landLine、phoneNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghaoo committed Oct 31, 2016
1 parent 0aaa6a4 commit 77fa990
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion js/component/keroa-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -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()
}
Expand Down Expand Up @@ -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){
Expand Down

0 comments on commit 77fa990

Please sign in to comment.