All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.modules.sys.dictionary.ctrl.zidian.item.subadd.js Maven / Gradle / Ivy

There is a newer version: 5.0.2101
Show newest version

define(function(require) {
	var ItemAdd = require('./zidian.item.add');
	
	var ZiDianItemAdd = ItemAdd.extend(function() {
		
		// @override
		this.submit = function(panel, data) {
			var table = this.parent.table;
			
			if (!table.ctreegrid('endEdit')) {
				return;
			}
			
			var row = table.treegrid('getSelected');
			var id = new Date().getTime(), newRow;
			
			if (row) {
				newRow = $.extend({
					_id: id,
					icon: "",
					extraCode: row.dataCode
				}, this.object, {catalogCode: this.parent.data.catalogCode});
				
				table.treegrid('append', {
					parent: row._id,
					data: [newRow]
				});
				
				// 开启编辑
				table.ctreegrid('beginEdit', 'dataCode', newRow);
			}
		};
	});
	
	return ZiDianItemAdd;
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy