1. #1
    Sencha Premium Member
    Join Date
    Nov 2011
    Location
    Portland, Oregon
    Posts
    18
    Answers
    1
    Vote Rating
    0
    isiphil is on a distinguished road

      0  

    Default Unanswered: Beta3 DataView XTemplate question now using itemTpl instead of tpl

    Unanswered: Beta3 DataView XTemplate question now using itemTpl instead of tpl


    Before Beta 3 we had a DataView that utilized an XTemplate to create one Header at the top using the x-toolbar class. I am struggling to mimic the following behavior. Any suggestions or pointers would be appreciated.

    Code:
    Ext.namespace('csi'); csi.wo__template = new Ext.XTemplate('<div><table class="invCLhead">',
    								'<tr class="x-toolbar x-toolbar-dark" style="font-weight: bold; color:white; vertical-align: middle;">',									
    									'<td class="invCLdsHead">Description</td>',
    									'<td class="invCLstHead">Status</td>',
    								'</tr></table></div>',
                                     '<tpl for=".">',
                                        '<div id = "div.clwrap">',
                                        '<table class="invCL"><tr>',                                    
                                        '<td class="invCLds">{question}</td>',
                                        '<td class="invCLst">{response}</td>',
                                        '</tr></table></div>',
                                    '</tpl>'
                                    );
                                            
    Ext.define('csi.view.WorkorderDataview',{
    	extend: 'Ext.DataView',
    	xtype: 'workorderDataview',
    	config: {
    	    title: "wo_dataview",
    	    useComponents: true,
    	    tpl: csi.wo_template,
    	    selectorId: 'workorderDataview',
    	    store: 'Workorder',
    	    scrollable: false,           
    	    emptyText:'<div class="emptytext">None Available<br></div><hr>'
    	}
    });
    This is the modified code in Beta3. I can get the DataView to render. However, Since the itemTpl is rendered for each line, I get the toolbar header everytime. Is it possible to get it only to render the first time?

    Code:
    Ext.namespace('csi'); csi.wo_template = new Ext.XTemplate('<div><table class="invCLhead">',
    								'<tr class="x-toolbar x-toolbar-dark" style="font-weight: bold; color:white; vertical-align: middle;">',									
    									'<td class="invCLdsHead">Description</td>',
    									'<td class="invCLstHead">Status</td>',
    								'</tr></table></div>',
                                     '<tpl for=".">',
                                        '<div id = "div.clwrap">',
                                        '<table class="invCL"><tr>',                                    
                                        '<td class="invCLds">{question}</td>',
                                        '<td class="invCLst">{response}</td>',
                                        '</tr></table></div>',
                                    '</tpl>'
                                    );
                                            
    Ext.define('csi.view.WorkorderDataview',{
    	extend: 'Ext.DataView',
    	xtype: 'workorderDataview',
    	config: {
    	    title: "wo_dataview",
    	    itemTpl: csi.wo_template,
    	    selectorId: 'workorderDataview',
    	    store: 'Workorder',
    	    scrollable: false,           
    	    emptyText:'<div class="emptytext">None Available<br></div><hr>'
    	}
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    750
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You can add a docked toolbar to the dataview or you can insert the element into the dataview list. You cannot do it with the template is what I am saying.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2011
    Location
    Portland, Oregon
    Posts
    18
    Answers
    1
    Vote Rating
    0
    isiphil is on a distinguished road

      0  

    Default


    Mitchell,
    Thanks for the quick response. That is what I was thinking but I just wanted to double check. I was just looking at your view.js file inside of Ext.ux.touch.grid. It looks like you use the docked toolbar as you suggest. We use this elsewhere in our app and I may just change this dataview into a grid.
    Thanks again.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar