Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- qx.Class.define('qx.ui.mobile.list.renderer.CheckBoxListItemRenderer', {
- extend : qx.ui.mobile.list.renderer.Abstract,
- // overridden
- construct : function () {
- this.base( arguments, new qx.ui.mobile.layout.HBox().set( { alignY: 'middle' } ) );
- this._init();
- },
- members : {
- __title : null,
- __subtitle : null,
- __checkbox : null,
- __leftContainer : null,
- getTitle : function () {
- return this.__title.getValue()
- },
- setTitle : function (title) {
- this.__title.setValue( title );
- },
- getSubTitle : function () {
- return this.__subtitle.getValue();
- },
- setSubTitle : function (subtitle) {
- this.__subtitle.setValue( subtitle );
- },
- getValue : function () {
- return this.__checkbox.getValue();
- },
- setValue : function (checked) {
- this.__checkbox.setValue( checked );
- },
- _init : function () {
- this.__leftContainer = this._createLeftContainer();
- this.add( this.__leftContainer, { flex: 1 } );
- this.__title = this._createTitle();
- this.__leftContainer.add( this.__title );
- this.__subtitle = this._createSubTitle();
- this.__leftContainer.add( this.__subtitle );
- this.__checkbox = this._createCheckBox();
- this.add( this.__checkbox );
- },
- _createLeftContainer : function () {
- return new qx.ui.mobile.container.Composite( new qx.ui.mobile.layout.VBox() );
- },
- _createTitle : function () {
- var title = new qx.ui.mobile.basic.Label();
- title.addCssClass( 'list-itemlabel' );
- return title;
- },
- _createSubTitle : function () {
- var subtitle = new qx.ui.mobile.basic.Label();
- subtitle.addCssClass( 'subtitle' );
- return subtitle;
- },
- _createCheckBox : function () {
- var checkbox = new qx.ui.mobile.form.CheckBoxListCheckBox();
- return checkbox;
- },
- // overridden
- _applyShowArrow : function (value, old) {
- return;
- },
- // overriden
- reset : function () {
- this.__title.setValue( '' );
- this.__subtitle.setValue( '' );
- this.__checkbox.setValue( false );
- }
- },
- // overriden
- destruct : function () {
- this._disposeObjects( '__title', '__subtitle', '__checkbox', '__leftContainer' );
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement