1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    0
    nitija is on a distinguished road

      0  

    Default Unanswered: Opening custom control as a model pop up

    Unanswered: Opening custom control as a model pop up


    messagebox.jpgHi,

    I am creating below control . On some different page i want this control to be displayed as "Model popup".How can i achieve this ?
    Ext.define('Lancet.asset.populations.Grid', {
    extend: 'Ext.grid.Panel',
    id: 'populationGrid',
    store: store,
    model: 'StepViewModel',
    modal: true,
    stateful: true,
    stateId: 'stateGrid',
    columns: [
    {
    text: 'Step Name',
    dataIndex: 'StepName',
    menuDisabled: true,
    sortable: false,
    enableColLock: true,
    enableColumnMove: false,
    autoExpandColumn: true,
    // locked: true,
    width: 75
    },
    {-----
    }});
    On some different page , on button click i want above control to be diaplayed. Below is code for Button click.

    Ext.define('Lancet.engine.asset.population.EditPopulation',
    {
    extend: 'Ext.button.Button',
    alias: 'EditPopulation',
    itemId: 'btnEditPopulation',
    itemId: 'btnEditPopulation',
    iconCls: 'edit16',
    disabled: false,
    listeners: {
    click: function () {
    win = new Ext.Window(
    {
    layout: 'fit',
    width: 500,
    height: 300,
    modal: true,
    isPanel: true,
    collapsed: true,
    frame: true,
    closeAction: 'hide',
    items: [
    Ext.create('Lancet.asset.populations.Grid', {

    })]
    });
    win.show();
    ----------
    ----------

    Problem is , it create instance of above control on button click , but two windows are displayed. I want only control to be loaded and Ext.Window which acts as a loader or parent should be hidden.
    kindly advice.
    Thanks in advance.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,328
    Answers
    3540
    Vote Rating
    849
    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 remove the model and modal configs you have on the Lancet.asset.populations.Grid definition.
    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 User
    Join Date
    Nov 2012
    Posts
    8
    Vote Rating
    0
    nitija is on a distinguished road

      0  

    Default


    Hi Thanks for reply. but I fixed it like this .,

    Ext.define('Lancet.engine.asset.population.NewPopulation',
    {
    extend: 'Ext.button.Button',
    alias: 'NewPopulation',
    itemId: 'btnNewPopulation',
    iconCls: 'new16',
    disabled: false,
    listeners: {
    click: function () {
    var populationGrid = Ext.create('Lancet.asset.populations.Grid', { preventHeader : true});
    populationGrid.store.loadData([], false);
    addpopWindow = new Ext.widget('window', {
    title: 'Add Populations',
    closeAction: 'destroy',
    width: 650,
    draggable: false,
    height: 400,
    closable: true,
    layout: 'fit',
    modal: false,
    items: [populationGrid], buttons: [{
    text: 'Close',
    handler: function () {
    addpopWindow.destroy();
    }
    }]
    }).show();
    }
    }
    });

Thread Participants: 1