Browse Source

Start table Component

pull/36/head
Artur Arseniev 9 years ago
parent
commit
d5aec38e57
  1. 45
      src/dom_components/model/ComponentTable.js
  2. 22
      src/dom_components/view/ComponentTableView.js

45
src/dom_components/model/ComponentTable.js

@ -0,0 +1,45 @@
define(['./ComponentText'],
function (Component) {
return Component.extend({
defaults: _.extend({}, Component.prototype.defaults, {
tagName: 'table',
columns: 3,
rows: 2,
traits: [{
label: 'Columns',
name: 'columns',
changeProp: 1,
},{
label: 'Rows',
name: 'rows',
changeProp: 1,
}]
}),
initialize: function(o, opt) {
Component.prototype.initialize.apply(this, arguments);
//this.listenTo(this, 'change:columns change:rows', this.render);
},
},{
/**
* Detect if the passed element is a valid component.
* In case the element is valid an object abstracted
* from the element will be returned
* @param {HTMLElement}
* @return {Object}
* @private
*/
isComponent: function(el) {
var result = '';
if(el.tagName == 'TABLE'){
result = {type: 'table'};
}
return result;
},
});
});

22
src/dom_components/view/ComponentTableView.js

@ -0,0 +1,22 @@
define(['backbone', './ComponentView'],
function (Backbone, ComponentView) {
return ComponentView.extend({
events: {},
/*
initialize: function(o){
ComponentView.prototype.initialize.apply(this, arguments);
this.classEmpty = this.ppfx + 'plh-map';
},
*/
/*
render: function() {
ComponentView.prototype.render.apply(this, arguments);
this.updateClasses();
this.el.appendChild(this.getIframe());
return this;
},
*/
});
});
Loading…
Cancel
Save