allenchow Posted November 15, 2016 Share Posted November 15, 2016 How to get tab spacing when pressing TAB inside unidbmemo component ? Thanks! Link to comment Share on other sites More sharing options...
Sherzod Posted November 15, 2016 Share Posted November 15, 2016 Hi, For now can you try this approach?!: For example for UniMemo, UniMemo1 -> ClientEvents -> ExtEvents -> keydown fn: function keydown(sender, e, eOpts) { if (e.keyCode === 9) { var val = this.value, start = this.inputEl.dom.selectionStart, end = this.inputEl.dom.selectionEnd; this.setValue(val.substring(0, start) + '\t' + val.substring(end)); this.inputEl.dom.selectionStart = this.inputEl.dom.selectionEnd = start + 1; return false; } } Best regards. Link to comment Share on other sites More sharing options...
allenchow Posted November 15, 2016 Author Share Posted November 15, 2016 Hi, For now can you try this approach?!: For example for UniMemo, UniMemo1 -> ClientEvents -> ExtEvents -> keydown fn: function keydown(sender, e, eOpts) { if (e.keyCode === 9) { var val = this.value, start = this.inputEl.dom.selectionStart, end = this.inputEl.dom.selectionEnd; this.setValue(val.substring(0, start) + '\t' + val.substring(end)); this.inputEl.dom.selectionStart = this.inputEl.dom.selectionEnd = start + 1; return false; } } Best regards. Yes, it works. But will lost focus afterwards. Any additional steps ? Thanks ! Link to comment Share on other sites More sharing options...
Sherzod Posted November 15, 2016 Share Posted November 15, 2016 which browser you are using?! Link to comment Share on other sites More sharing options...
allenchow Posted November 15, 2016 Author Share Posted November 15, 2016 It's ok now. Just disable tabstop . Thanks !! Link to comment Share on other sites More sharing options...
allenchow Posted January 26, 2017 Author Share Posted January 26, 2017 It's weird that it doesn't work again , maybe after upgrade to 1.0 beta ? When I press <TAB> inside the dbmemo, it lost focus , but when I click the dbmemo again, it stops at the new tab position .... Please check . Thanks ! Link to comment Share on other sites More sharing options...
allenchow Posted January 26, 2017 Author Share Posted January 26, 2017 Anyone can help and test ? Link to comment Share on other sites More sharing options...
Sherzod Posted January 26, 2017 Share Posted January 26, 2017 Hi, We are analyzing.. Best regards. Link to comment Share on other sites More sharing options...
allenchow Posted January 26, 2017 Author Share Posted January 26, 2017 THANKS A LOT !! Link to comment Share on other sites More sharing options...
Sherzod Posted January 26, 2017 Share Posted January 26, 2017 Can you try this approach for now?!: function keydown(sender, e, eOpts) { if (e.keyCode === 9) { var val = this.value, start = this.inputEl.dom.selectionStart, end = this.inputEl.dom.selectionEnd; this.setValue(val.substring(0, start) + '\t' + val.substring(end)); this.inputEl.dom.selectionStart = this.inputEl.dom.selectionEnd = start + 1; Ext.defer(function(){ sender.focus(false); }, 10); return false; } } Link to comment Share on other sites More sharing options...
allenchow Posted January 27, 2017 Author Share Posted January 27, 2017 not work ... still lost focus Link to comment Share on other sites More sharing options...
Sherzod Posted January 27, 2017 Share Posted January 27, 2017 Hi Hmm, which browser are you using?! Link to comment Share on other sites More sharing options...
allenchow Posted January 27, 2017 Author Share Posted January 27, 2017 Chrome Link to comment Share on other sites More sharing options...
allenchow Posted January 27, 2017 Author Share Posted January 27, 2017 Yup, inside firefox it's ok... Link to comment Share on other sites More sharing options...
Sherzod Posted January 27, 2017 Share Posted January 27, 2017 Ok, I will check Link to comment Share on other sites More sharing options...
allenchow Posted January 27, 2017 Author Share Posted January 27, 2017 Thanks a lot ! Link to comment Share on other sites More sharing options...
Sherzod Posted January 27, 2017 Share Posted January 27, 2017 seems it is a bug in Chrome Can you check in here too?!: http://jsfiddle.net/jz6J5/ Link to comment Share on other sites More sharing options...
allenchow Posted January 27, 2017 Author Share Posted January 27, 2017 but it works with this example Link to comment Share on other sites More sharing options...
Sherzod Posted January 27, 2017 Share Posted January 27, 2017 Then pls, can you make a small test case for this?! Link to comment Share on other sites More sharing options...
allenchow Posted January 27, 2017 Author Share Posted January 27, 2017 Suddenly it works.... Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now