allenchow Posted November 15, 2016 Share Posted November 15, 2016 How to get tab spacing when pressing TAB inside unidbmemo component ? Thanks! Quote 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. Quote 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 ! Quote 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?! Quote 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 !! Quote 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 ! Quote 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 ? Quote 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. Quote Link to comment Share on other sites More sharing options...
allenchow Posted January 26, 2017 Author Share Posted January 26, 2017 THANKS A LOT !! Quote 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; } } Quote 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 Quote 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?! Quote Link to comment Share on other sites More sharing options...
allenchow Posted January 27, 2017 Author Share Posted January 27, 2017 Chrome Quote 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... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 27, 2017 Share Posted January 27, 2017 Ok, I will check Quote Link to comment Share on other sites More sharing options...
allenchow Posted January 27, 2017 Author Share Posted January 27, 2017 Thanks a lot ! Quote 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/ Quote 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 Quote 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?! Quote Link to comment Share on other sites More sharing options...
allenchow Posted January 27, 2017 Author Share Posted January 27, 2017 Suddenly it works.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.