1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    61
    Answers
    3
    Vote Rating
    0
    azinyama is on a distinguished road

      0  

    Default Unanswered: Drag & Drop To Different Model

    Unanswered: Drag & Drop To Different Model


    Good day all!!!

    I have three different models that look like this:

    Code:
    Ext.define('ClaimCatch_RIS.model.Tariff',
    {
        extend: 'Ext.data.Model',
        
        fields  : 
        [
            {
                name: 'Tariff_RowID', 
                type: 'int'
            },
            {
                name: 'Tariff_Code', 
                type: 'string'
            },
            {
                name: 'Tariff_Descr', 
                type: 'string'
            },
            {
                name: 'Tariff_NAMAS', 
                type: 'float'
            },
            {
                name: 'Tariff_AFHOZ', 
                type: 'float'
            },
            {
                name: 'Tariff_Cash', 
                type: 'float'
            }
        ]
    });

    Code:
    Ext.define('ClaimCatch_RIS.model.TariffGroup',
    {
        extend: 'Ext.data.Model',
        
        fields  : 
        [
            {
                name: 'Group_RowID', 
                type: 'int'
            },
            {
                name: 'Procedure_RowID', 
                type: 'int'
            },
            {
                name: 'Group_Descr', 
                type: 'string'
            }
        ]
    });

    Code:
    Ext.define('ClaimCatch_RIS.model.TariffGroupTariff',
    {
        extend: 'Ext.data.Model',
            
        fields  :
        [
            {
                name: 'Group_Tariff_RowID',
                type: 'int'
            },
            {
                name: 'Group_RowID',
                type: 'int'
            },
            {
                name: 'Tariff_Code', 
                type: 'string'
            },
            {
                name: 'Group_Tariff_Qty', 
                type: 'int'
            },
            {
                name: 'Modifier_Descr',
                type: 'string'
            }
        ]
    });
    I have three grids: 'Tariffs', 'TariffGroup' and 'TariffGroupTariff'. I am dragging a row from 'Tariffs' and dropping it in 'TariffGroupTariff'. Grid 'TariffGroupTariff'will show the Tariff_Code that is because grid 'Tariffs' has the same feild. And that is where I'm getting stuck; because what I want to also happen is:
    1. Before I drag I would have selected a row from grid 'TariffGroup' and I want Group_RowID to be passed to grid 'TariffGroupTariff';
    2. And I would like 'Group_Tariff_Qty' and 'Modifier_Descr' to have the default values 1 and '00' set respectively when the selected row is dropped into 'TariffGroupTariff'.
    Any suggestions on how I could do this...

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You should be able to update the record in the store for each. Here is a quick example of 3 grids.
    http://www.sencha.com/forum/showthread.php?239658

    Scott.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    61
    Answers
    3
    Vote Rating
    0
    azinyama is on a distinguished road

      0  

    Default


    Thanks for the reply, but I don't think that is what I'm look for. The three grids in the example all have the same columns. Think I didn't explain myself properly. Here is an image of the girds:

    Tariffs.jpg

    Tariff - Contains list of all available tariffs
    TariffGroup - Is a group that consists of a any number of tariffs
    TariffGroupTariff - List of tariffs that are in TariffGroup

    Looking at the image above what happens is, when I select a group (CT Scan - Joints) the tariffs that are in that group are listed below in TariffGroupTariff.
    When I want to add another tariff to the group I drag it from Tariff and drop it in TariffGroupTariff.

    My question is:
    TariffGroupTariff has a column 'Group_RowID' whose value I wanted assigned from the selected group (CT Scan - Joints)in TariffGroup.

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You could use record.set() to update the field based on the dropped record:

    Code:
    var record = ddSource.dragData.selections[0];
    var fieldName = secondGrid.getColumnModel().getDataIndex(col);
    var value = record.get(fieldName);
    Scott.

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    61
    Answers
    3
    Vote Rating
    0
    azinyama is on a distinguished road

      0  

    Default


    Hi!!! Thanx for the reply. I have tried to do that, but with no luck.I'm using the rowediting plugin, so when I drag the Tariff to TariffGroupTariff it is dropped and fires the create method, at which point the value hasn't been set. Then in the beforedrop drop event I use the record.set() which then sets the value and fires the create method again. How do I go about stopping from firing the before I set the value. Thought that if I set it the the beforedrop event would only fire once.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi