WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 some difficulty about Grid Widget, chsw1984, March 4, 2004
     Re:some difficulty about Grid Widget, Emil A Eklund, March 4, 2004
         Re:some difficulty about Grid Widget , chsw1984, March 5, 2004
         Re:some difficulty about Grid Widget, Erik Arvidsson, March 4, 2004

Subject: Re:some difficulty about Grid Widget From: chsw1984 Date: March 5, 2004

Thanks for your help, Can u tell me why i can't find this structure  in <Microsoft Jscript Reference>,and where can I see this.

-----------------------------------------------------------------------------

From: Emil A Eklund
Sent: March 4, 2004
Subject: Re:some difficulty about Grid Widget

It's a data structure thats used like a static object; the words before each colon is a name of a property and whats right of it is the value of that property. Some of those properties, as you can see, has the keyword function directly after the colon, thus effectively turning those proprieties into methods.

Please note that this description is not entirely correct, I'm merely trying to describe what's going on.

A much simpler example

var foo = {
value: 10,
test: function(n) { return n - value; }
};

var a = foo.value; // a = 10
var b = foo.test(100); // b = 100 - foo.value (10) = 90

/Emil
-------------------------------------------------------



webFXGridHandler is
I have download the Grid Widget source code ,and found some difficulty on reading it .
can anyone tell me what is the meanings of the charactor colon in the source below ? I can't find this operator in Jscript reference . Thanks.

//source start
var webFXGridHandler = {
idCounter : 0,
idPrefix : "webfx-grid-object-",
getId : function() { return this.idPrefix + this.idCounter++; },
all : {},
scroll : function(id) { this.all[id]._scroll(); },
resize : function(id) { this.all[id].calcSize(); },
click : function() { var e = getElement(window.event.srcElement); if (e) { this.all[e.id].click(); } },
select : function() {
var e = getElement(window.event.srcElement);
if ((e) && (e.tagName == 'TD')) {
var s = e.parentNode.parentNode.parentNode.parentNode.className;
if (s == 'webfxGridMain') { this.all[e.id].select(); }
else if (s == 'webfxGridMainIdCol') { this.all[e.rowid].select(true); }
}
},
deselect : function() { var e = getElement(window.event.srcElement); if ((e) && (e.tagName == 'TD') && (this.all[e.id])) { this.all[e.id].parent.deselect(); } },
over : function() { var e = getElement(window.event.srcElement); if ((e) && (e.tagName == 'TD') && (this.all[e.id])) { this.all[e.id].parent.over(); } },
out : function() { var e = getElement(window.event.srcElement); if ((e) && (e.tagName == 'TD') && (this.all[e.id])) { this.all[e.id].parent.out(); } },
keydown : function() { var e = getElement(window.event.srcElement); if ((e) && (e.tagName == 'TD') && (this.all[e.id])) { this.all[e.id].parent.parent._selected._handleKey(); } },
//select : function() { return (window.event.srcElement.tagName == 'INPUT')?true:false; },
boxkey : function() { return this.all[window.event.srcElement.id]._handleKey(); },
boxblur : function() { this.all[window.event.srcElement.id]._blurBox(); },
sort : function(id, col) { this.all[id].sort(col); },
headDown : function(e) { this.all[e.id]._headDown(); },
headUp : function(e) { this.all[e.id]._headUp(); },
headMove : function(e) { this.all[e.id]._headMove(); }
};
//






Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX