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. #21
    Sencha - Services Team
    Join Date
    Mar 2007
    Location
    Foristell, MO
    Posts
    1,108
    Vote Rating
    3
    jratcliff is on a distinguished road

      0  

    Default


    Thanks for reporting the IE8 cursor location. I missed that before so I'm looking into that now.

  2. #22
    Sencha User
    Join Date
    Aug 2007
    Posts
    43
    Vote Rating
    0
    JimStoner is on a distinguished road

      0  

    Default


    Hi,

    I think I have a fix for the IE8 problem. It may not be the best solution, but it seems to work.

    I found a function called setCaretPosition() on the web site http://blog.vishalon.net/index.php/j...on-in-textarea

    I then added one extra line to my override for gridHandleKeyDown, which calls that function after the Ext.MessageBox.prompt, like this:

    Code:
    Ext.MessageBox.prompt('Starts with...', 'Search text ', this.quickSearch, this, false, String.fromCharCode(keyCode));
    setCaretPosition.defer(1,this,[Ext.MessageBox.getDialog().focusEl.dom, 1])
    Note that I used Ext's DEFER method to delay calling it for 1 millisecond. Without that, if I call the setCaretPosition immediately, it occasionally caused weird results, like having two characters show up in the prompt instead of one. Based on some other testing, it looks like something else in Ext or ExtND is rewriting that input value (maybe some other event handler?). By deferring the call to setCaretPosition by even just 1 millisecond, it seems to fix that problem, and it correctly places the cursor at the end of the line in both Firefox and IE8.

    Here's the relevant portion of my bug fix script file, with all the changes near the bottom:
    Code:
    Ext.nd.UIView.override( {
        gridHandleKeyDown: function(e){
            if (e.getTarget().name == 'xnd-vw-search') {
                return;
            }
            var sm, ds, node, row, rowIndex, unid, target;
            var keyCode = e.browserEvent.keyCode;
            var charCode = e.charCode;
            
            target = e.getTarget();
            sm = this.getSelectionModel();
            row = sm.selections.itemAt(sm.selections.length-1);
            ds = this.getStore();
            rowIndex = (row && row.unid && ds && ds.data) ? ds.data.findIndex('unid', row.unid) : -1;
            
            // for now, we won't worry about the altKey
            if (e.altKey) {
                return;
            }
            
            // if Ctrl+E
            if (e.ctrlKey && keyCode == 69) {
                this.openDocument(this, rowIndex, e, true);
                return;
            }
            
            // for now, we won't worry about all other ctrlKey clicks
            if (e.ctrlKey) {
                return;
            }
            
            // we don't worry about the shift key, unless another key is typed
            if (e.shiftKey && keyCode == 16) {
                return;
            }
            
            switch (keyCode) {
                case e.RETURN:
                    this.openDocument(this, rowIndex, e);
                    break;
                case e.DELETE:
                    if (row) {
                        this.deleteDocument(this, rowIndex, e);
                    }
                    break;
                    
                case e.BACKSPACE:
                case e.DOWN:
                case e.ESC:
                case e.F5:
                case e.HOME:
                case e.LEFT:
                case e.PAGEDOWN:
                case e.PAGEUP:
                case e.RIGHT:
                case e.UP:
                case e.TAB:
                    break;
                    
                // in the Notes client toggling the space bar 
                // will toggle whether the doc is selected or not in a view
                case e.SPACE:
                    if (sm.isSelected(rowIndex)) {
                        sm.deselectRow(rowIndex);
                    }
                    else {
                        sm.selectRow(rowIndex);
                    }
                    break;
                default:
    /* START CHANGE
    	The message box for the quick search is not displaying the character
    	you pressed to open the quick search.  The function is being passed
    	the charCode, which is 0.  Change that so it passes the character
    	corresponding to the keyCode instead.  
    	In addition, in IE8 the cursor doesn't always get left at the end,
    	sometimes it is at the start.  Use setCaretPosition() to force the issue
    	but it has to be delayed slightly to always work consistently.
    */
                    Ext.MessageBox.prompt('Starts with...', 'Search text ', this.quickSearch, this, false, String.fromCharCode(keyCode));
                    setCaretPosition.defer(1,this,[Ext.MessageBox.getDialog().focusEl.dom, 1])
    //                Ext.MessageBox.prompt('Starts with...', 'Search text ', this.quickSearch, this, false, charCode);
    /* END CHANGE */
            }
        }
    })
    
    // NEW FUNCTION NEEDED BY THE CHANGE TO gridHandleKeyDown()
    // Function taken from http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea
    function setCaretPosition(ctrl, pos){
    	if(ctrl.setSelectionRange)
    	{
    		ctrl.focus();
    		ctrl.setSelectionRange(pos,pos);
    	}
    	else if (ctrl.createTextRange) {
    		var range = ctrl.createTextRange();
    		range.collapse(true);
    		range.moveEnd('character', pos);
    		range.moveStart('character', pos);
    		range.select();
    	}
    }

  3. #23
    Sencha - Services Team
    Join Date
    Mar 2007
    Location
    Foristell, MO
    Posts
    1,108
    Vote Rating
    3
    jratcliff is on a distinguished road

      0  

    Default


    Hi Jim, thanks for posting this solution, I will add this to the current code since everyone will like this for sure

  4. #24
    Sencha User
    Join Date
    Dec 2010
    Posts
    16
    Vote Rating
    0
    jhachero is on a distinguished road

      0  

    Default


    Hi Jim and Jack,

    Good day.

    I have tried the suggestion of Jim and it worked for me. Many thanks to the both of you for sharing your knowledge and providing solutions to my inqueries.

    Just one more request if you please...

    What do I need to change in the code so that 1st record of the result of the view would be highlighted after I have click on the 'Ok' button or hit the enter key?

    Thank you.

    Regards,
    Jhachero

  5. #25
    Sencha User
    Join Date
    Aug 2007
    Posts
    43
    Vote Rating
    0
    JimStoner is on a distinguished road

      0  

    Default


    Hi Jhachero,

    I'm afraid I won't have a chance to work on that request, at least not immediately. I can point you towards the area of code you would need to update, however. I think you would need to add some new code to the Quick Search callback function, so that after it loads the new results it gets a pointer to the grid and selects the first row. I don't know enough Ext to know how to do that off the top of my head, and I don't have the time right now to research it.

    Here's a copy of my bug-fix code from above, plus an override for the Ext.nd.UIView.quickSearch() method that is the callback function for the Quick Search. I've put in some comments at the end of the quickSearch() method to show what I think you'll need to do, but you'll need to figure out how to actually write that code (or maybe someone else on here can help). Look for the section of comments starting with "// START CHANGE TO AUTO-SELECT ROW AFTER QUICK SEARCH" to find the spot where I think you'll need to update the code.

    Good luck!
    Jim

    Code:
    Ext.nd.UIView.override( {
        gridHandleKeyDown: function(e){
            if (e.getTarget().name == 'xnd-vw-search') {
                return;
            }
            var sm, ds, node, row, rowIndex, unid, target;
            var keyCode = e.browserEvent.keyCode;
            var charCode = e.charCode;
            
            target = e.getTarget();
            sm = this.getSelectionModel();
            row = sm.selections.itemAt(sm.selections.length-1);
            ds = this.getStore();
            rowIndex = (row && row.unid && ds && ds.data) ? ds.data.findIndex('unid', row.unid) : -1;
            
            // for now, we won't worry about the altKey
            if (e.altKey) {
                return;
            }
            
            // if Ctrl+E
            if (e.ctrlKey && keyCode == 69) {
                this.openDocument(this, rowIndex, e, true);
                return;
            }
            
            // for now, we won't worry about all other ctrlKey clicks
            if (e.ctrlKey) {
                return;
            }
            
            // we don't worry about the shift key, unless another key is typed
            if (e.shiftKey && keyCode == 16) {
                return;
            }
            
            switch (keyCode) {
                case e.RETURN:
                    this.openDocument(this, rowIndex, e);
                    break;
                case e.DELETE:
                    if (row) {
                        this.deleteDocument(this, rowIndex, e);
                    }
                    break;
                    
                case e.BACKSPACE:
                case e.DOWN:
                case e.ESC:
                case e.F5:
                case e.HOME:
                case e.LEFT:
                case e.PAGEDOWN:
                case e.PAGEUP:
                case e.RIGHT:
                case e.UP:
                case e.TAB:
                    break;
                    
                // in the Notes client toggling the space bar 
                // will toggle whether the doc is selected or not in a view
                case e.SPACE:
                    if (sm.isSelected(rowIndex)) {
                        sm.deselectRow(rowIndex);
                    }
                    else {
                        sm.selectRow(rowIndex);
                    }
                    break;
                default:
    /* START CHANGE
    	The message box for the quick search is not displaying the character
    	you pressed to open the quick search.  The function is being passed
    	the charCode, which is 0.  Change that so it passes the character
    	corresponding to the keyCode instead.  
    	In addition, in IE8 the cursor doesn't always get left at the end,
    	sometimes it is at the start.  Use setCaretPosition() to force the issue
    	but it has to be delayed slightly to always work consistently.
    */
                    Ext.MessageBox.prompt('Starts with...', 'Search text ', this.quickSearch, this, false, String.fromCharCode(keyCode));
                    setCaretPosition.defer(1,this,[Ext.MessageBox.getDialog().focusEl.dom, 1])
    //                Ext.MessageBox.prompt('Starts with...', 'Search text ', this.quickSearch, this, false, charCode);
    /* END CHANGE */
            }
        } ,
        
        quickSearch: function(btn, text){
            var ds = this.getStore();
            if (btn == 'ok') {
                // first, remove the start param from the lastOptions.params
                delete ds.lastOptions.params.start;
                // next, load dataSrource, passing the startkey param
                ds.load({
                    params: Ext.apply(ds.lastOptions.params, {startkey: text})
                }); // append the startkey param to the existing params (ds.lastOptions)
            }
    
            // START CHANGE TO AUTO-SELECT ROW AFTER QUICK SEARCH
            // We need to get a pointer to the first row and somehow select it.
            // I'm not sure if the "first row" means the first entry in the data store, the Ext SelectionModel,
            // or something in the Ext.nd.UIView grid panel itself.  
            // You can use the code from the gridHandleKeyDown() method to see various ways to get
            // pointers to the relevant objects.  The following code is an example of how that method gets
            // pointers to the selection model, row, data store, etc.  
            // 
            // sm = this.getSelectionModel();
            // row = sm.selections.itemAt(sm.selections.length-1);
            // ds = this.getStore();
            // rowIndex = (row && row.unid && ds && ds.data) ? ds.data.findIndex('unid', row.unid) : -1;
            // 
            // You'll need to figure out what needs to be 'selected' for your application's requirements, 
            // and then how to select it.
    
        }
    
    })
    
    // NEW FUNCTION NEEDED BY THE CHANGE TO gridHandleKeyDown()
    // Function taken from http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea
    function setCaretPosition(ctrl, pos){
    	if(ctrl.setSelectionRange)
    	{
    		ctrl.focus();
    		ctrl.setSelectionRange(pos,pos);
    	}
    	else if (ctrl.createTextRange) {
    		var range = ctrl.createTextRange();
    		range.collapse(true);
    		range.moveEnd('character', pos);
    		range.moveStart('character', pos);
    		range.select();
    	}
    }

  6. #26
    Sencha User
    Join Date
    Dec 2010
    Posts
    16
    Vote Rating
    0
    jhachero is on a distinguished road

      0  

    Default


    Quote Originally Posted by JimStoner View Post
    Hi Jhachero,

    I'm afraid I won't have a chance to work on that request, at least not immediately. I can point you towards the area of code you would need to update, however. I think you would need to add some new code to the Quick Search callback function, so that after it loads the new results it gets a pointer to the grid and selects the first row. I don't know enough Ext to know how to do that off the top of my head, and I don't have the time right now to research it.

    Here's a copy of my bug-fix code from above, plus an override for the Ext.nd.UIView.quickSearch() method that is the callback function for the Quick Search. I've put in some comments at the end of the quickSearch() method to show what I think you'll need to do, but you'll need to figure out how to actually write that code (or maybe someone else on here can help). Look for the section of comments starting with "// START CHANGE TO AUTO-SELECT ROW AFTER QUICK SEARCH" to find the spot where I think you'll need to update the code.

    Good luck!
    Jim

    Code:
    Ext.nd.UIView.override( {
        gridHandleKeyDown: function(e){
            if (e.getTarget().name == 'xnd-vw-search') {
                return;
            }
            var sm, ds, node, row, rowIndex, unid, target;
            var keyCode = e.browserEvent.keyCode;
            var charCode = e.charCode;
            
            target = e.getTarget();
            sm = this.getSelectionModel();
            row = sm.selections.itemAt(sm.selections.length-1);
            ds = this.getStore();
            rowIndex = (row && row.unid && ds && ds.data) ? ds.data.findIndex('unid', row.unid) : -1;
            
            // for now, we won't worry about the altKey
            if (e.altKey) {
                return;
            }
            
            // if Ctrl+E
            if (e.ctrlKey && keyCode == 69) {
                this.openDocument(this, rowIndex, e, true);
                return;
            }
            
            // for now, we won't worry about all other ctrlKey clicks
            if (e.ctrlKey) {
                return;
            }
            
            // we don't worry about the shift key, unless another key is typed
            if (e.shiftKey && keyCode == 16) {
                return;
            }
            
            switch (keyCode) {
                case e.RETURN:
                    this.openDocument(this, rowIndex, e);
                    break;
                case e.DELETE:
                    if (row) {
                        this.deleteDocument(this, rowIndex, e);
                    }
                    break;
                    
                case e.BACKSPACE:
                case e.DOWN:
                case e.ESC:
                case e.F5:
                case e.HOME:
                case e.LEFT:
                case e.PAGEDOWN:
                case e.PAGEUP:
                case e.RIGHT:
                case e.UP:
                case e.TAB:
                    break;
                    
                // in the Notes client toggling the space bar 
                // will toggle whether the doc is selected or not in a view
                case e.SPACE:
                    if (sm.isSelected(rowIndex)) {
                        sm.deselectRow(rowIndex);
                    }
                    else {
                        sm.selectRow(rowIndex);
                    }
                    break;
                default:
    /* START CHANGE
    	The message box for the quick search is not displaying the character
    	you pressed to open the quick search.  The function is being passed
    	the charCode, which is 0.  Change that so it passes the character
    	corresponding to the keyCode instead.  
    	In addition, in IE8 the cursor doesn't always get left at the end,
    	sometimes it is at the start.  Use setCaretPosition() to force the issue
    	but it has to be delayed slightly to always work consistently.
    */
                    Ext.MessageBox.prompt('Starts with...', 'Search text ', this.quickSearch, this, false, String.fromCharCode(keyCode));
                    setCaretPosition.defer(1,this,[Ext.MessageBox.getDialog().focusEl.dom, 1])
    //                Ext.MessageBox.prompt('Starts with...', 'Search text ', this.quickSearch, this, false, charCode);
    /* END CHANGE */
            }
        } ,
        
        quickSearch: function(btn, text){
            var ds = this.getStore();
            if (btn == 'ok') {
                // first, remove the start param from the lastOptions.params
                delete ds.lastOptions.params.start;
                // next, load dataSrource, passing the startkey param
                ds.load({
                    params: Ext.apply(ds.lastOptions.params, {startkey: text})
                }); // append the startkey param to the existing params (ds.lastOptions)
            }
    
            // START CHANGE TO AUTO-SELECT ROW AFTER QUICK SEARCH
            // We need to get a pointer to the first row and somehow select it.
            // I'm not sure if the "first row" means the first entry in the data store, the Ext SelectionModel,
            // or something in the Ext.nd.UIView grid panel itself.  
            // You can use the code from the gridHandleKeyDown() method to see various ways to get
            // pointers to the relevant objects.  The following code is an example of how that method gets
            // pointers to the selection model, row, data store, etc.  
            // 
            // sm = this.getSelectionModel();
            // row = sm.selections.itemAt(sm.selections.length-1);
            // ds = this.getStore();
            // rowIndex = (row && row.unid && ds && ds.data) ? ds.data.findIndex('unid', row.unid) : -1;
            // 
            // You'll need to figure out what needs to be 'selected' for your application's requirements, 
            // and then how to select it.
    
        }
    
    })
    
    // NEW FUNCTION NEEDED BY THE CHANGE TO gridHandleKeyDown()
    // Function taken from http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea
    function setCaretPosition(ctrl, pos){
    	if(ctrl.setSelectionRange)
    	{
    		ctrl.focus();
    		ctrl.setSelectionRange(pos,pos);
    	}
    	else if (ctrl.createTextRange) {
    		var range = ctrl.createTextRange();
    		range.collapse(true);
    		range.moveEnd('character', pos);
    		range.moveStart('character', pos);
    		range.select();
    	}
    }
    Hi JimStoner and Jratcliff,

    Thank you guys for helping me out on this issue. I was able to have the 'autoselect the first row' worked after doing the search input.

    Regards,

    Jhachero

  7. #27
    Sencha User
    Join Date
    Dec 2011
    Posts
    2
    Vote Rating
    -1
    mr.mitom is an unknown quantity at this point

      -1  

    Default www.trungtamsimsodep.com

    www.trungtamsimsodep.com


    Thank you very much.

  8. #28
    Sencha User
    Join Date
    May 2010
    Posts
    2
    Vote Rating
    0
    gwood is on a distinguished road

      0  

    Default


    Hi Jack. When you mention current code, do you mean the zip file you made available earlier in this thread or do you have a more recent version?

  9. #29
    Sencha User
    Join Date
    Mar 2012
    Posts
    1
    Vote Rating
    -1
    ty11gould is an unknown quantity at this point

      -1  

    Default


    Quote Originally Posted by jratcliff View Post
    here ya go. unzip this file and replace the corresponding files in your extnd.nsf database with these and let me know if this works for you.
    Great! Thanks for sharing!

  10. #30
    Sencha User
    Join Date
    Jun 2013
    Posts
    5
    Vote Rating
    -4
    weiguangcun can only hope to improve

      -1  

    Default very good

    very good


    haha,good thread

Similar Threads

  1. Replies: 6
    Last Post: 23 Nov 2010, 12:57 PM
  2. problem grid search input css
    By pasblin in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Mar 2009, 1:02 AM
  3. Search Attention Ticket & Edit Input Screen
    By egoicovic in forum Community Discussion
    Replies: 2
    Last Post: 30 Mar 2007, 2:43 PM

Thread Participants: 7