Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    38
    Answers
    1
    Vote Rating
    3
    panbayi is on a distinguished road

      0  

    Default Unanswered: Celledtiting 'edit' event and Button 'click' event

    Unanswered: Celledtiting 'edit' event and Button 'click' event


    I have a grid of which plugin is cellediting,and I add a listener to detect the 'edit' event of it so when user input wrong value in it I can alert a MessageBox.At the same time,the grid has a toolbar which contains a button(let's call it 'cancel'),when user click 'cancel' button , the store will ignore the changes user made.
    Here is the problem : when I click the 'cancel' button while I'm inputing in the cell,it's the cellediting's 'edit' event invoked not the 'click' event of 'cancel' button.

    Any help will be appreciated.Thank you so much!

  2. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,074
    Answers
    111
    Vote Rating
    94
    Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light

      0  

    Default


    without looking at some code, it would be difficult to say. Could you create a simple working case and put it on jsfiddle.net?

  3. #3
    Sencha User
    Join Date
    Dec 2012
    Posts
    38
    Answers
    1
    Vote Rating
    3
    panbayi is on a distinguished road

      0  

    Default


    sorry,I can't get access to the url,SO I put the code here.
    Code:
    //I use MVC 
    //here is view
    Ext.define('MyApp.view.MyPanel',{
        //extend...
        //alias...
        //some other properties like 'titles','store'
        initComponent : function(){
            var me=this;
            Ext.applyIf(me,{
                columns : [
                    {
                        xtype : 'id',
                        dataIndex : 'uid',
                        editor : {
                            xtype : 'textfield'
                        }
                    }
                    {
                        xtype : 'name',
                        dataIndex : 'uname',
                        editor : {
                            xtype : 'textfield'
                        }
                    }
                    //...some other columns
                ],
                dockedItems : [
                    {
                        xtype : 'toolbar',
                        dock : 'top',
                        items : [
                            {
                                xtype : 'button',//when I click this button,this button and the 'confirm' button will hide , the other buttons like 'edit','insert'will show.At the same time,the grid turns uneditable.
                                text : 'cancel',
                                id : 'cl'
                            },
                            {
                                xtype ; 'button',//when I click this button,the changes will be saved by store.sync()
                                text ; 'confirm',
                                id : 'ok'
                            },
                            //some  buttons named 'edit','delete',insert'
                            
                        ]
                        
                    }
                ],
                plugins : [
                    Ext.create('Ext.grid.plugin.CellEditing',{
                        clickToEdit : 1,
                        listeners : {
                            'edit' : function(editor,ctx){
                                //I will send a request to check the value,if invalid, I alert a messagebox to remind the user
                            }
                        }
                    }
                ]
            me.callParents(arguments);
            })
        }
    });
     //here is the controller
    Ext.define('MyApp.controller.MyController',{
        //extend ...
        //requires
        //views,I'm sure I add MyPanel here
        //models ...
        //stores ...
        init : function(){
            this.control({
                'button[id=cl]' :{
                    click : me.cancel
                },
                'button[id=ok]' :{
                    click : me.confirm
                }
                
            })
        },
        cancel : function(){
            alert('Changes will be ignored and button will hide');
        },
        confirm : function(){
            alert('changes will be saved and grid turns uneditable');
        }
    });
                  
    //now is the problem ,when I click the 'cancel' button while I input wrong value in the cell(cursor in the cell),a messagebox is shown which means the 'click' event of the 'cancel' button is not fired but the 'edit' event is fired
    //I wished the 'click' event will be fired not the 'edit' event of the cellediting
    Last edited by panbayi; 29 Jan 2013 at 12:29 AM. Reason: correct wrong words

  4. #4
    Sencha User
    Join Date
    Dec 2012
    Posts
    38
    Answers
    1
    Vote Rating
    3
    panbayi is on a distinguished road

      0  

    Default


    Quote Originally Posted by Farish View Post
    without looking at some code, it would be difficult to say. Could you create a simple working case and put it on jsfiddle.net?
    Hi,I wondered whether you have checked this thread recently,so I reply again. Hope you can solve this or give me some advice!

    Thank you!

  5. #5
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,074
    Answers
    111
    Vote Rating
    94
    Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light

      0  

    Default


    I am not much familiar with the MVC architecture but it could be that you have some syntax error in the ccontroller code which causes it not to work. Firstly, I dont know if you have copy/pasted your code or typed it in (or some parts). "define" is misspelled as "defien" in Ext.define in your controller. When you end this.controller(), you should put a semi-colon after it. Take a look at the MVC architecture example and compare your code:

    http://docs.sencha.com/ext-js/4-0/#!...n_architecture

  6. #6
    Sencha User
    Join Date
    Dec 2012
    Posts
    38
    Answers
    1
    Vote Rating
    3
    panbayi is on a distinguished road

      0  

    Default


    Quote Originally Posted by Farish View Post
    I am not much familiar with the MVC architecture but it could be that you have some syntax error in the ccontroller code which causes it not to work. Firstly, I dont know if you have copy/pasted your code or typed it in (or some parts). "define" is misspelled as "defien" in Ext.define in your controller. When you end this.controller(), you should put a semi-colon after it. Take a look at the MVC architecture example and compare your code:

    http://docs.sencha.com/ext-js/4-0/#!...n_architecture
    Thank you !

    Hm,I typed it ,I'm sorry for the wrong word.My original code is somehow too long to put it here and there are a lot of Chinese words in it.

    Thank you for you reply again!

  7. #7
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,074
    Answers
    111
    Vote Rating
    94
    Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light

      0  

    Default


    is it working now? please share the fix so that others having a similar problem may also benefit.

  8. #8
    Sencha User
    Join Date
    Dec 2012
    Posts
    38
    Answers
    1
    Vote Rating
    3
    panbayi is on a distinguished road

      0  

    Default


    Quote Originally Posted by Farish View Post
    is it working now? please share the fix so that others having a similar problem may also benefit.
    Not yet...,I hope someone can give me some advice

Thread Participants: 1