1. #1
    Sencha Premium Member ethraza's Avatar
    Join Date
    Jun 2007
    Location
    Brazil
    Posts
    366
    Vote Rating
    9
    ethraza is on a distinguished road

      0  

    Question Trying out my first aux - Form Field Mask

    Because Architect crash hard the canvas by ignoring Resources, I'm trying to convert my Field Masking plugin into a Architect User Extension.
    (Canvas issue and plugin usage here: http://www.sencha.com/forum/showthre...se-of-a-plugin)


    The problem right now is that the blog post "Building a User Extension part 2" and the Docs, just say about aux carring view components, it say nothing about ExtJs plugins.

    So, it is a plugin. It needs to be called within a form field in the plugin config option.
    How do I do that?

    The aux I have till now is attached here (renamed to zip so it can be attached).
    But it shows itself inside Architect as a component to be added to a view and not a plugin to be added to a component. It's probably just some stuff in the package.json or Definition.js, but I don't know what.



    I hope this aux will be very useful for other people when the package is working right, cuz there is nothing similar in the sencha marketplace.
    Thank you for any help.
    Attached Files
    LAMPE (Linux / Apache / MySQL / PHP / ExtJs)

  2. #2
    Sencha User Juvs's Avatar
    Join Date
    Oct 2007
    Posts
    36
    Vote Rating
    2
    Juvs is on a distinguished road

      1  

    Default Same situation...

    I have a similar plugin, is designed for fields, not for Panels, the docs from Architect says (see this link) for definition file:

    validParentTypes:

    Array of valid parent types (use strings corresponding to xtype) for this object; if any types are listed here, this component will only be allowed to be dropped onto components matching one of the types in this list

    validChildTypes:

    Array of valid child types for this object; if any components are listed here, they are the only types of components that can be children to this component

    So I set validParentTypes to "textfield", but still can't attach to this kind of component.

    Maybe is some limitation with Architect, folks from Sencha: any advice?

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    321
    Vote Rating
    30
    honestbleeps has a spectacular aura about honestbleeps has a spectacular aura about

      0  

    Default

    sorry it took some time to respond here, ethraza -- it appears what you need to do is update your component to extend Ext.AbstractPlugin and then it works in Architect and doesn't crash anything. If you need the functionality of Ext.util.Observable - you can always include that as a mixin.
    Steve Sobel
    @honestbleeps
    Sencha Architect Development Team

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Posts
    321
    Vote Rating
    30
    honestbleeps has a spectacular aura about honestbleeps has a spectacular aura about

      0  

    Default

    Quote Originally Posted by Juvs View Post
    I have a similar plugin, is designed for fields, not for Panels, the docs from Architect says (see this link) for definition file:

    validParentTypes:

    Array of valid parent types (use strings corresponding to xtype) for this object; if any types are listed here, this component will only be allowed to be dropped onto components matching one of the types in this list

    validChildTypes:

    Array of valid child types for this object; if any components are listed here, they are the only types of components that can be children to this component

    So I set validParentTypes to "textfield", but still can't attach to this kind of component.

    Maybe is some limitation with Architect, folks from Sencha: any advice?
    Hmm, how are you listing your validParentTypes, exactly? Can you share your definition with us?
    Steve Sobel
    @honestbleeps
    Sencha Architect Development Team

  5. #5
    Sencha User Juvs's Avatar
    Join Date
    Oct 2007
    Posts
    36
    Vote Rating
    2
    Juvs is on a distinguished road

      1  

    Default

    For now we are just setting textfield using xtype, here the sample:

    PHP Code:
    {
        
    "classAlias""plugin.clearbutton",
        
    "className""Ext.ux.form.field.ClearButton"
        
    "inherits""abstractplugin",
        
    "autoName""MyClearButtonPlugin",
        
    "helpText""<b>Ext.ux.form.field.ClearButton</b><br>Plugin for text components that shows a clear button over the text field. When the button is clicked the text field is set empty. Works with Ext.form.field.Text, Ext.form.field.TextArea, Ext.form.field.ComboBox and Ext.form.field.Date.",
        
    "validParentTypes": ["textfield"],

        
    "toolbox": {
            
    "name""Clear Button Plugin",
            
    "category""Form Fields",
            
    "groups": ["Forms"]
        },
    ... 
    Also we try extend the plugin using Ext.AbstractPlugin but still same issue. See the attach file, when we try to drag & drop into Text Field, we just can't.

    error-plugin-architect.png

    This plugin is base on extension Ext.ux.form.field.ClearButton by Fortis IT Services GmbH

    Here's the complete zip file for the plugin, just unzip this on your extensions directory (configure on Architect) to test.
    Attached Files

  6. #6
    Sencha Premium Member ethraza's Avatar
    Join Date
    Jun 2007
    Location
    Brazil
    Posts
    366
    Vote Rating
    9
    ethraza is on a distinguished road

      0  

    Default

    Ext.AbstractPlugin didn't work to my aux as well.
    LAMPE (Linux / Apache / MySQL / PHP / ExtJs)

Thread Participants: 2

Tags for this Thread