![]() | |
#1
| |||
| |||
|
|
Are there any other Javascript UI libraries other than ExtJS 2.0 and Yahoo! UI library that are as good as ExtJS |
|
but without the license restrictions that ExtJS imposes on commercial usage ? I am after tree controls that have drag and drop for example. |
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Try http://DHTMLGoodies.com |
#4
| |||
| |||
|
|
On Jul 1, 7:11*am, "Aaron Gray" <ang.use... (AT) gmail (DOT) com> wrote: |
|
1. That obj.constructor === Array returns true doesn't guarantee that obj is an array any more than obj.constructor !== Array means it isn't, however it should be trustworthy as long as the obj's constructor's prototype hasn't been messed with. |
|
URL:http://groups.google.com.au/group/co...tree/browse_fr.... -- Rob |
#5
| ||||
| ||||
|
|
On Jul 1, 6:46*am, RobG <rg... (AT) iinet (DOT) net.au> wrote: On Jul 1, 7:11*am, "Aaron Gray" <ang.use... (AT) gmail (DOT) com> wrote: 1. That obj.constructor === Array returns true doesn't guarantee that obj is an array any more than obj.constructor !== Array means it isn't, however it should be trustworthy as long as the obj's constructor's prototype hasn't been messed with. The constructor's prototype can be changed, and doesn't cause the reference to be changed. var a = Array(); Array.prototype.a = 1; a.constructor === Array; |
|
The Array constructor created that object a. After that, the constructor property was altered, and it is still a's constructor. |
|
The problem with the checking the constructor is that there is a different Array constructor for each window. document.frames[0].Array ! == Array; If the object had a different constructor property: a.constructor = 1; a.constructor === Array; // false. |
|
Array.prototype.isPrototypeOf(a); // true, but still doesn't account for different frames' Arrays. |
#6
| ||||
| ||||
|
|
On Jul 2, 6:59*am, dhtml <dhtmlkitc... (AT) gmail (DOT) com> wrote: On Jul 1, 6:46*am, RobG <rg... (AT) iinet (DOT) net.au> wrote: On Jul 1, 7:11*am, "Aaron Gray" <ang.use... (AT) gmail (DOT) com> wrote: 1. That obj.constructor === Array returns true doesn't guaranteethat obj is an array any more than obj.constructor !== Array means it isn't, however it should be trustworthy as long as the obj's constructor's prototype hasn't been messed with. The constructor's prototype can be changed, and doesn't cause the reference to be changed. var a = Array(); Array.prototype.a = 1; a.constructor === Array; My comment was in relation to the linked post by Lasse which shows that the constructor property is inherited from Array.prototype, so: * function myArray(){} * myArray.prototype = Array.prototype; * var x=new myArray(); * alert(x.constructor == Array); *// -> true Oh I see. |
|
but x will not have the special length property that an array should have, so it isn't really an Array. |
|
That is different to messing with the prototype *- the inherited constructor property is masked by a.constructor. |
|
-- Rob |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
I think the topic of this thread has derailed a bit. Here is Andrea Giammarchi's take on subclassing Array .http://webreflection.blogspot.com/20...-unlocked-leng...If Andrea had read Lasse's post, he might have reconsidered. |
|
= the array's length, then the array's length gets increased to N+1; |
|
- JDD |
![]() |
| Thread Tools | |
| Display Modes | |
| |