souza.fo Posted March 18, 2012 Share Posted March 18, 2012 I recently read this very interesting post (http://www.rahulsingla.com/blog/2011/11/extjs-and-iscroll-scrolling-ext-containers-on-touch-devices-ipad-iphone-etc-using-iscro). Is it possible to use IScroll with Unigui? Regards Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 20, 2012 Administrators Share Posted March 20, 2012 Easy: 1) Add below JS code to MainForm's Script property Ext.override(Ext.Panel, { afterRender: Ext.Panel.prototype.afterRender.createSequence(function() { if (this.getXType() == 'panel') { this._getIScrollElement = function() { return (this.el.child('.x-panel-body', true)); } } //Uncomment below to use iScroll only on mobile devices but use regular scrolling on PCs. if (this.autoScroll /*&& Ext.isMobileDevice*/) { if (this._getIScrollElement) { this._updateIScroll(); this.on('afterlayout', this._updateIScroll); } } }), _ensureIScroll: function() { if (!this.iScroll) { var el = this._getIScrollElement(); if (el.children.length > 0) { this.iScroll = new iScroll(el); this.iScrollTask = new Ext.util.DelayedTask(this._refreshIScroll, this); } } }, _updateIScroll: function() { this._ensureIScroll(); if (this.iScroll) { this.iScrollTask.delay(1000); } }, _refreshIScroll: function() { this.iScroll.refresh(); //Refresh one more time. this.iScrollTask.delay(1000); } }); Ext.override(Ext.tree.TreePanel, { _getIScrollElement: function() { return (this.el.child('.x-panel-body', true)); } }); Ext.override(Ext.grid.GridPanel, { _getIScrollElement: function() { return (this.el.child('.x-grid3-scroller', true)); }, afterRender: Ext.grid.GridPanel.prototype.afterRender.createSequence(function() { //TODO: need to hook into more events and to update iScroll. this.view.on('refresh', this._updateIScroll, this); }) }); 2) Download iScroll.js file and add it to UniServerModule->CustomFiles Quote Link to comment Share on other sites More sharing options...
souza.fo Posted March 20, 2012 Author Share Posted March 20, 2012 I could not make it work. Does it really works with Unigui? The idea is to make the application a little better when used by mobile devices with Android, IOS, etc.. Regards Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 20, 2012 Administrators Share Posted March 20, 2012 It worked here, but I only tested in desktop firefox. Quote Link to comment Share on other sites More sharing options...
souza.fo Posted March 21, 2012 Author Share Posted March 21, 2012 I managed to get it working in Chrome desktop. But it did not work on android (Default Browser and Opera Mobile Browser). I will test with other browsers. Regards Quote Link to comment Share on other sites More sharing options...
souza.fo Posted March 22, 2012 Author Share Posted March 22, 2012 I was able to run on Android. However I can not select items in the grid when I'm using Android. Even clicking, I can not select. Is there anything I can do to force the selection of the record in the Grid? If this works, it will help me a lot until the unigui support Sencha touch. Regards Quote Link to comment Share on other sites More sharing options...
themrigi Posted May 5, 2012 Share Posted May 5, 2012 not iscroll, but it is scrollbar. http://forums.unigui.com/index.php?/topic/1967-grid-scrollbars-on-mobil-browsers/#entry8722 Quote Link to comment Share on other sites More sharing options...
dionel1969 Posted May 6, 2012 Share Posted May 6, 2012 Could be add this sample code to the section for this???? Quote Link to comment Share on other sites More sharing options...
KingOrmon Posted November 22, 2013 Share Posted November 22, 2013 TuniHTMLFrame could be scrolled with this code ? 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.