Sch.plugin.Lines + MVC (JAVA demo example)

Community plugins and extensions
Post Reply
User avatar
kimF
Posts: 3
Joined: Wed Aug 14, 2013 4:15 pm

Sch.plugin.Lines + MVC (JAVA demo example)

Post by kimF » Wed Aug 14, 2013 4:49 pm

Hello,

I am currently evaluating the Scheduler. I tried to integrate the Sch.plugin.Lines plugin with your "JAVA demo" example but I does not work.

Here are the steps I did for integration:

Created app/model/MyLine.js:

Code: Select all

Ext.define('DEMO.model.MyLine', {
	extend : 'Ext.data.Model',
	fields  : [ 'Date', 'Text', 'Cls' ]
});
and created app/store/MyLines.js:

Code: Select all

Ext.define('DEMO.store.MyLines', {
	extend : 'Ext.data.Store',
	model : 'DEMO.model.MyLine',
	data : [ {
		Date : new Date(2013, 7, 14, 16)
	} ]
});
in app/controller/Scheduler.js, added the new store and model:

Code: Select all

[...]
models	: [
        'Event', 
        'Resource',
        'MyLine'
    ],

stores	: [
	  	'Events',
        'Resources',
        'MyLines'
    ]
[...]
added in app/view/Scheduler.js:

Code: Select all

plugins : [	   
	   Ext.create('Sch.plugin.Lines', {
           store : 'MyLines'
       })
    ]
Like in the JAVA demo example the file index.html includes these 2 libs:

Code: Select all

<!--Ext lib -->
    <script src="http://cdn.sencha.com/ext/gpl/4.2.1/ext-all.js" type="text/javascript"></script>
    
    <!-- App Files -->
    <script src="http://bryntum.com/examples/scheduler-latest/sch-all-debug.js" type="text/javascript"></script>
After refreshing the page, the debugger pauses on an exception, see screen shot:
debug ss
debug ss
8-14-2013 4-43-18 PM.png (45.01 KiB) Viewed 5499 times
What am I doing wrong? Is this a known bug?

Here are the source files:
app.zip
source files
(5.46 KiB) Downloaded 438 times
Thanks in advance for your help,
kimF

User avatar
kimF
Posts: 3
Joined: Wed Aug 14, 2013 4:15 pm

Re: Sch.plugin.Lines + MVC (JAVA demo example)

Post by kimF » Wed Aug 14, 2013 6:10 pm

after using ext-all-dev.js I managed to see the following error in the debug console:

"Uncaught TypeError: Object MyLines has no method 'on'"

User avatar
nickolay
Core Developer
Core Developer
Posts: 3399
Joined: Mon May 16, 2011 10:48 am

Re: Sch.plugin.Lines + MVC (JAVA demo example)

Post by nickolay » Wed Aug 14, 2013 6:57 pm

I think the cause is that Lines plugin does not accept `store` config as a string. You need to provide an actual store instance to it.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
mats
Core Developer
Core Developer
Posts: 15590
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: Sch.plugin.Lines + MVC (JAVA demo example)

Post by mats » Wed Aug 14, 2013 10:31 pm

Fixed now in master, in next release it'll work!
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
kimF
Posts: 3
Joined: Wed Aug 14, 2013 4:15 pm

Re: Sch.plugin.Lines + MVC (JAVA demo example)

Post by kimF » Thu Aug 15, 2013 8:08 am

Great. Thanks for your replies. I will push my manager to buy the license :D

Post Reply