Hybrid View

  1. #1
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,181
    Vote Rating
    77
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default Trigger field - triggerclick is not exposed by API so controllers cant catch it

    Trigger field - triggerclick is not exposed by API so controllers cant catch it


    Hi.

    I finally have some spare time so I can play a little with Designer.

    I'm trying to replicate some of my hand-crafted views with Designer but first problem is that I cant use ux's SearchField which I use a lot. I could use trigger field instead (SearchField is based on it after all) but "triggerclick" event isnt exposed (well, doesn't exists at all). So trigger field is, for now, useless.

    So, how I should solve this?

    BTW, "triggerclick" or "triggerNclick" (trigger1click, trigger2click, etc.) should be exposed in trigger field so we can use such field in MVC applications out of the box.

    When we will have custom components support in Designer?

    Else, ability to override methods of promoted components to classes? For now we can add event code to the components so I guess the support for overriding / adding new methods is almost there. Something like the ability to add new custom properties. With this feature we could at least extend existing components which is, I guess, what almost everybody needs.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 MVC
    Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
    Application Server: Glassfish 3.1.x
    Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5

    If you like my answer please vote!

  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,181
    Vote Rating
    77
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    It seems that basic funtion can only be added to top level containers.

    How difficult could be to allow basic functions on components promoted to classes?

    An special build with this?

    Lets concern about usability later (ex: "override method wizard" or check correct override structure, etc.)

    Please, make my weekend a Designer's weekend!

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 MVC
    Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
    Application Server: Glassfish 3.1.x
    Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5

    If you like my answer please vote!

  3. #3
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,181
    Vote Rating
    77
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    bump.

    No body else using trigger fields?
    UI: Sencha Architect 3.x / ExtJS 4 MVC
    Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
    Application Server: Glassfish 3.1.x
    Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5

    If you like my answer please vote!

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Location
    Latvia
    Posts
    6
    Vote Rating
    0
    martins108 is on a distinguished road

      0  

    Default


    Did you found answer how to use trigger field in mvc controller?

  5. #5
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,181
    Vote Rating
    77
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    Using triggerfield in controller is easy.

    Create your own trigger which exposes triggerclickevent, this is mine:

    Code:
    Ext.define("pp.lib.component.TriggerFieldClick", {
    	extend : "Ext.form.field.Trigger",
    	alias : "widget.triggerfieldclick",
    
    
    	enableKeyEvents : true,
    
    
    	listeners : {
    		keyup : function(f, e) {
    			if (f.hideTrigger) {
    				return;
    			}
    			var key = e.getKey();
    			if (key == e.ENTER || (key == e.SPACE && !f.editable)) {
    				f.fireEvent("triggerclick", f, e);
    			}
    		}
    	},
    
    
    	afterRender : function() {
    		var me = this, body = me.bodyEl;
    		me.callParent();
    		me.mon(body, "dblclick", me.onDblClick, me);
    	},
    
    
    	onTriggerClick : function(e) {
    		var me = this;
    		if (!me.hideTrigger) {
    			me.fireEvent("triggerclick", me, e);
    		}
    	},
    
    
    	onDblClick : function(e) {
    		var me = this;
    		if (!me.hideTrigger) {
    			me.fireEvent("triggerclick", me, e);
    		}
    	}
    });
    Just use in your views and controllers. For example:

    Code:
    init : function() {
    		this.control(
    						"empeditar [name=grupoNombre]" : {
    				triggerclick : this.buscarGrupo
    			},
    ...
    Problem is that you cant do this with Designer.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 MVC
    Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
    Application Server: Glassfish 3.1.x
    Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5

    If you like my answer please vote!

  6. #6
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,883
    Vote Rating
    102
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Quote Originally Posted by ssamayoa View Post
    Problem is that you cant do this with Designer.
    The approach you outlined above would work fine in designer. THere is one enhancement that we need to make that will allow you to complete that workflow. That is the ability to type in your own custom event names and not require that the user pick something that is from the targetType.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

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