PDA

View Full Version : SpinnerField Problem : "Ext.ux.Spinner is not a constructor"



talha06
5 Mar 2010, 5:43 AM
Hello everyone,

I see an error called "Ext.ux.Spinner is not a constructor" despite I didn't explicitly create SpinnerField object. Here's my code please, can someone help me..
Thanx...



var mySpinnerField = new Ext.ux.form.SpinnerField({
fieldLabel : '<b>Ya??n?z</b>',
id : 'mySpinnerField',
minValue: 18,
maxValue: 75,
allowDecimals: false,
//decimalPrecision: 1,
incrementValue: 1,
alternateIncrementValue: 2,
accelerate: true
});

var myForm = new Ext.form.FormPanel({
id : 'myForm',
renderTo : document.body,
frame : true,
border : true,
autoHeight : true,
title : 'SpinnerField Form',
width : 700,
items : [ mySpinnerField ]
});

Animal
5 Mar 2010, 5:45 AM
You have to include the Ext.ux.Spinner class in your page!

Why am I saying this? That's just what Javascript has told you!

talha06
5 Mar 2010, 5:50 AM
You have to include the Ext.ux.Spinner class in your page!

Why am I saying this? That's just what Javascript has told you!

Thanx for reply, but I've already included 'Spinner.js' in my page.

<script src="./extjs/src/ux/SpinnerField.js"></script>

I attached Firebug screenshot too..

Animal
5 Mar 2010, 5:51 AM
Spinner != SpinnerField

The error message says it all really if you read it.

talha06
5 Mar 2010, 5:55 AM
Spinner != SpinnerField

The error message says it all really if you read it.
I wrote wrong by mistake; but as u see above I included the right file : 'SpinnerField.js'..

Animal
5 Mar 2010, 5:59 AM
<shoots self>

fay
5 Mar 2010, 6:21 AM
<shoots self>

Crikey, I haven't stopped laughing at that one :))

You haven't included

<script src="./extjs/src/ux/Spinner.js"></script>

If you read the top of the source code for SpinnerField.js:


* Creates a field utilizing Ext.ux.Spinner

implying that you also need to include Spinner.js in your header.

talha06
5 Mar 2010, 6:27 AM
Crikey, I haven't stopped laughing at that one :))

You haven't included

<script src="./extjs/src/ux/Spinner.js"></script>

If you read the top of the source code for SpinnerField.js:



implying that you also need to include Spinner.js in your header.
fay, thank you so much for your reply.. I'm here to learn Ext JS as good as possible.. So I'm ready to accept all these ridicules..

Thanx again..
With regards,
Talha

Zdeno
5 Mar 2010, 6:43 AM
But this isnt about ExtJS but about OOP and including files. Well if the firebug say the something isnt constuctor im going to debug this error, going to look in to files and find "the class". Same with other languages: if you want to use any class in any language you got two way: include the file with class or just define the class in file when you are using it.

First what i do if i need anything: google.com

https://subtrac.sara.nl/oss/jobmonarch/browser/trunk/web/addons/job_monarch/lib/extjs-30/examples/spinner/spinner.html

Example of using Spinner



..
<!-- extensions -->
<script type="text/javascript" src="../ux/Spinner.js"></script>
<script type="text/javascript" src="../ux/SpinnerField.js"></script>
..

talha06
5 Mar 2010, 6:48 AM
But this isnt about ExtJS but about OOP and including files. Well if the firebug say the something isnt constuctor im going to debug this error, going to look in to files and find "the class". Same with other languages: if you want to use any class in any language you got two way: include the file with class or just define the class in file when you are using it.

First what i do if i need anything: google.com

https://subtrac.sara.nl/oss/jobmonarch/browser/trunk/web/addons/job_monarch/lib/extjs-30/examples/spinner/spinner.html

Example of using Spinner



..
<!-- extensions -->
<script type="text/javascript" src="../ux/Spinner.js"></script>
<script type="text/javascript" src="../ux/SpinnerField.js"></script>
..

Thank you for your recommendations, truly I searched a lot about SpinnerField and how to use it. And I saw that there are many bug reports that people shared at many forums, portals. Anyway thank you so much for the link, as I see it's really an useful site, truly I've been looking a site like this for a long time..

Zdeno
5 Mar 2010, 6:55 AM
More informations about spinner/spinnerfield/spinnerplugin for you:

http://www.extjs.com/forum/showthread.php?t=16352
http://www.extjs.com/forum/showthread.php?t=22663

talha06
5 Mar 2010, 6:59 AM
More informations about spinner/spinnerfield/spinnerplugin for you:

http://www.extjs.com/forum/showthread.php?t=16352
http://www.extjs.com/forum/showthread.php?t=22663
yeah thanx, I was looking these two pages just now.. :)