The forum operates in read-only mode. Please head to StackOverflow for support.
var MyObject = { Foo : 'bar', ShowFileInfo : function ( fileUrl, data ) { alert( 'The selected URL is "' + fileUrl + '". Foo: ' + this.Foo ) ; } } MyObject.Foo = 'baz' ; function MySelectFunction( fileUrl, data ) { return MyObject.ShowFileInfo( fileUrl, data ) ; } var finder = new CKFinder() ; finder.BasePath = '../../' ; finder.SelectFunction = MySelectFunction ; finder.Create() ;
Wiktor Walc CTO, CKSource - http://cksource.com -- Follow CKEditor on: Twitter | Facebook | Google+
var MyObject = { ShowFileInfo : function ( fileUrl, data ) { alert( 'The selected URL is "' + fileUrl) ; }, OpenFileBrowser: function () { var finder = new CKFinder() ; finder.BasePath = '../../' ; finder.SelectFunction = (function (scope) { return function(fileUrl, data) { (function(){ this.ShowFileInfo(fileUrl, data); }).call(scope); } })(this); finder.Create() ; } }
Re: feature request - SelectFunction by reference
var MyObject = { Foo : 'bar', ShowFileInfo : function ( fileUrl, data ) { alert( 'The selected URL is "' + fileUrl + '". Foo: ' + this.Foo ) ; } } MyObject.Foo = 'baz' ; function MySelectFunction( fileUrl, data ) { return MyObject.ShowFileInfo( fileUrl, data ) ; } var finder = new CKFinder() ; finder.BasePath = '../../' ; finder.SelectFunction = MySelectFunction ; finder.Create() ;Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: feature request - SelectFunction by reference
What I would like to do is get an object's function called directly:
var MyObject = { ShowFileInfo : function ( fileUrl, data ) { alert( 'The selected URL is "' + fileUrl) ; }, OpenFileBrowser: function () { var finder = new CKFinder() ; finder.BasePath = '../../' ; finder.SelectFunction = (function (scope) { return function(fileUrl, data) { (function(){ this.ShowFileInfo(fileUrl, data); }).call(scope); } })(this); finder.Create() ; } }Re: feature request - SelectFunction by reference
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+