-
-
-
method:Yahoo.widget.Button ( element, attributes )
return type:Button
content:ใช้สร้าง object Button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
comment:ตัวแปร element คือ id ของ element หรือ dom element ที่ต้องการให้เกิดการกระทำนี้
ตัวแปร attributes คือ ใช้กำหนดคุณสมบัติให้กับ object เช่น checked, container, disabled, href เป็นต้น
-
method:addStateCSSClasses ( )
return type:void
content:ใช้กำหนดให้มีการเพิ่ม state css class เข้าไปใน button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.addStateCSSClasses ( );
-
method:blur ( )
return type:void
content:ใช้กำหนดให้ button สูญเสีย focus
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.blur ( );
-
method:createButtonElement ( type )
return type:HTMLElement
content:ใช้สร้าง button ใหม่ โดยมี type ตามที่กำหนด
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
var element = checkbox_button.createButtonElement ( "menu" );
comment:ตัวแปร type คือ กำหนดประเภทของ button ได้แก่ radio, checkbox, menu, split
-
method:createHiddenFields ( )
return type:HTMLInputElement
content:ใช้สร้าง hidden field ให้กับ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
var hidden = checkbox_button.createHiddenFields ( );
-
method:destroy ( )
return type:void
content:ใช้ลบ button ออก
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.destroy ();
-
method:focus ( )
return type:void
content:ใช้กำหนดให้ button ได้รับ fucus
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.focus ();
-
method:getForm ( )
return type:HTMLFormElement
content:ใช้คืนค่า form ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
var form = checkbox_button.getForm ();
-
method:getHiddenFields ( )
return type:HTMLInputElement Array
content:ใช้คืนค่า hidden field ของ button โดยคืนค่ามาแบบ array
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
var hiddens = checkbox_button.getHiddenFields ( );
-
method:getMenu ( )
return type:YAHOO.widget.Overlay, YAHOO.widget.Menu
content:ใช้คืนค่า menu
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
var menu = checkbox_button.getMenu ( );
-
method:hasFocus ( )
return type:boolean
content:ใช้ตรวจสอบว่า button กำลังได้รับ focus อยู่หรือไม่
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
if ( checkbox_button.hasFocus ( ) )
{
alert ( "button is focusing." );
}
-
method:init ( element, attributes )
return type:void
content:ใช้กำหนดค่าเริ่มต้นต่างๆให้กับ object button ( เป็น constructor ของ Yahoo.util.Button )
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.init ( "checkbutton", { label: "my button" } );
comment:ตัวแปร element คือ id ของ element หรือ dom element ที่ต้องการให้เกิดการกระทำนี้
ตัวแปร attributes คือ ใช้กำหนดคุณสมบัติให้กับ object เช่น checked, container, disabled, href เป็นต้น
-
method:initAttributes ( attributes )
return type:void
content:ใช้กำหนดค่าเริ่มต้นของคุณสมบัติต่างๆ ให้กับ object button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.initAttributes ( { label: "my button" } );
comment:ตัวแปร attributes คือ ใช้กำหนดคุณสมบัติให้กับ object
เช่น checked, container, disabled, href เป็นต้น
-
method:isActive ( )
return type:boolean
content:ใช้ตรวจสอบว่า button กำลัง active อยู่หรือไม่
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
if ( checkbox_button.isActive ( ) )
{
alert ( "button is active now." );
}
-
method:removeHiddenFields ( )
return type:void
content:ใช้ลย hidden field ทั้งหมดของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
var hidden_1 = checkbox_button.createHiddenFields ( );
var hidden_2 = checkbox_button.createHiddenFields ( );
checkbox_button.removeHiddenFields ( );
-
method:removeStateCSSClasses ( )
return type:void
content:ใช้ลบ state css class ออกจาก button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.addStateCSSClasses ( );
checkbox_button.removeStateCSSClasses ( );
-
method:toString ( )
return type:string
content:ใช้คืนค่า ข้อความที่อธิบายเกี่ยวกับ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
alert ( checkbox_button.toString ( ) );
-
method:beforeCheckedChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่สถานะการ checked ของ button เปลี่ยนแปลง
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.beforeCheckedChange.subscribe (
function ( event )
{
alert ( "before checked change" );
}
);
-
method:beforeContainerChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง container ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.beforeContainerChange.subscribe (
function ( event )
{
alert ( "before container change" );
}
);
-
method:beforeDisabledChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง สถานะ disable ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.beforeDisabledChange.subscribe (
function ( event )
{
alert ( "before disable change" );
}
);
-
method:beforeFocusmenuChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
สถานะการได้รับ focus ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.beforeFocusmenuChange.subscribe (
function ( event )
{
alert ( "before focus change" );
}
);
-
method:beforeHrefChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ href ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.beforeHrefChange.subscribe (
function ( event )
{
alert ( "before href change" );
}
);
-
method:beforeLabelChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง คุณสมบัติ label ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button( "checkbutton", attributes );
checkbox_button.beforeLabelChange.subscribe (
function ( event )
{
alert ( "before label change" );
}
);
-
method:beforeMenualignmentChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ menualignment ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeMenualignmentChange.subscribe (
function ( event )
{
alert ( "before menualignment change" );
}
);
-
method:beforeMenuChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ menu ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeMenuChange.subscribe (
function ( event )
{
alert ( "before menu change" );
}
);
-
method:beforeMenuclassnameChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ menuclassname ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeMenuclassnameChange.subscribe (
function ( event )
{
alert ( "before menuclassname change" );
}
);
-
method:beforeMenumaxheightChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ menumaxheight ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeMenumaxheightChange.subscribe (
function ( event )
{
alert ( "before menumaxheight change" );
}
);
-
method:beforeMenuminscrollheightChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ menuminscrollheight ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeMenuminscrollheightChange.subscribe (
function ( event )
{
alert ( "before menuminscrollheight change" );
}
);
-
method:beforeNameChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ name ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeNameChange.subscribe (
function ( event )
{
alert ( "before name change" );
}
);
-
method:beforeOnclickChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ onclick ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeOnclickChange.subscribe (
function ( event )
{
alert ( "before onclick change" );
}
);
-
method:beforeReplaceLabelChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ replacelabel ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeReplaceLabelChange.subscribe (
function ( event )
{
alert ( "before replacelabel change" );
}
);
-
method:beforeSelectedMenuItemChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ selectedmenuitem ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeSelectedMenuItemChange.subscribe (
function ( event )
{
alert ( "before selectedmenuitem change" );
}
);
-
method:beforeSrcelementChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ srcelement ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeSrcelementChange.subscribe (
function ( event )
{
alert ( "before srcelement change" );
}
);
-
method:beforeTabindexChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ tabindex ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeTabindexChange.subscribe (
function ( event )
{
alert ( "before tabindex change" );
}
);
-
method:beforeTargetChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ target ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeTargetChange.subscribe (
function ( event )
{
alert ( "before target change" );
}
);
-
method:beforeTitleChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ title ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeTitleChange.subscribe (
function ( event )
{
alert ( "before title change" );
}
);
-
method:beforeTypeChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ type ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeTypeChange.subscribe (
function ( event )
{
alert ( "before type change" );
}
);
-
method:beforeValueChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ ก่อนที่จะเปลี่ยนแปลง
คุณสมบัติ value ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.beforeValueChange.subscribe (
function ( event )
{
alert ( "before value change" );
}
);
-
method:blur ( )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ button ได้รับ focus
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
function onBlur = function ( ) { alert ( "button lost focus" ); }
checkbox_button.on ( "blur", onBlur );
-
method:checkedChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลงสถานะ
checked ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.checkedChange.subscribe (
function ( event )
{
alert ( "checked change" );
}
);
-
method:containerChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
container ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.containerChange.subscribe (
function ( event )
{
alert ( "container change" );
}
);
-
method:disabledChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
สถานะ disabled ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.disabledChange.subscribe (
function ( event )
{
alert ( "disabled change" );
}
);
-
method:focus ( )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ button ได้รับ focus
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
function onFocus = function ( ) { alert ( "button gain focus" ); }
checkbox_button.on ( "focus", onFocus );
-
method:focusmenuChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ focusmenu ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.focusmenuChange.subscribe (
function ( event )
{
alert ( "focusmenu change" );
}
);
-
method:hrefChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ href ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.hrefChange.subscribe (
function ( event )
{
alert ( "href change" );
}
);
-
method:labelChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ label ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.labelChange.subscribe (
function ( event )
{
alert ( "label change" );
}
);
-
method:lazyloadmenuChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ lazyloadmenu ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.lazyloadmenuChange.subscribe (
function ( event )
{
alert ( "lazyloadmenu change" );
}
);
-
method:menualignmentChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ menualignment ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.menualignmentChange.subscribe (
function ( event )
{
alert ( "menualignment change" );
}
);
-
method:menuChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ menu ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.menuChange.subscribe (
function ( event )
{
alert ( "menu change" );
}
);
-
method:menuclassnameChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ menuclassname ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.menuclassnameChange.subscribe (
function ( event )
{
alert ( "menuclassname change" );
}
);
-
method:menumaxheightChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ menumaxheight ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.menumaxheightChange.subscribe (
function ( event )
{
alert ( "menumaxheight change" );
}
);
-
method:menuminscrollheightChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ menuminscrollheight ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.menuminscrollheightChange.subscribe (
function ( event )
{
alert ( "menuminscrollheight change" );
}
);
-
method:nameChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ name ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.nameChange.subscribe (
function ( event )
{
alert ( "name change" );
}
);
-
method:onclickChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ onclick ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.onclickChange.subscribe (
function ( event )
{
alert ( "onclick change" );
}
);
-
method:option ( )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการ click
ที่ปุ่มลูกศรที่ใช้แสดงรายการ ( option ) ออกมา
example:var attributes = { type: "split", menu: "splitbutton2select" };
var checkbox_button = new YAHOO.widget.Button ( "splitbutton", attributes );
function onOption = function ( ) { alert ( "you click option" ); }
checkbox_button.on ( "option", onOption );
-
method:replaceLabelChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ replacelabel ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.replaceLabelChange.subscribe (
function ( event )
{
alert ( "replacelabel change" );
}
);
-
method:selectedMenuItemChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ selectedmenuitem ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.selectedMenuItemChange.subscribe (
function ( event )
{
alert ( "selectedmenuitem change" );
}
);
-
method:srcelementChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ srcelement ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.srcelementChange.subscribe (
function ( event )
{
alert ( "srcelement change" );
}
);
-
method:tabindexChange ( event )
return type:
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ tabindex ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.tabindexChange.subscribe (
function ( event )
{
alert ( "tabindex change" );
}
);
-
method:targetChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ target ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.targetChange.subscribe (
function ( event )
{
alert ( "target change" );
}
);
-
method:titleChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ title ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.titleChange.subscribe (
function ( event )
{
alert ( "title change" );
}
);
-
method:typeChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ type ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.typeChange.subscribe (
function ( event )
{
alert ( "type change" );
}
);
-
method:valueChange ( event )
return type:void
content:เป็นการกำหนดให้ function ทำงาน เมื่อ มีการเปลี่ยนแปลง
คุณสมบัติ value ของ button
example:var attributes = { label: "One" };
var checkbox_button = new YAHOO.widget.Button ( "checkbutton", attributes );
checkbox_button.valueChange.subscribe (
function ( event )
{
alert ( "value change" );
}
);
-
config:checked
value:boolean
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนดสถานะการ checked ให้กับ button โดยจะใช้ได้กับ type คือ radio หรือ button เท่านั้น
( default value คือ false )
example:var attributes = { type: "radio", checked: true };
var radio_button = new YAHOO.widget.Button ( "radioButton", attributes );
-
config:container
value:HTMLElement, String ที่เป็นค่า id ของ container
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด container ให้กับ button
( default value คือ null )
example:var attributes = { container: "container_radio" };
var radio_button = new YAHOO.widget.Button ( "radioButton", attributes );
-
config:disabled
value:boolean
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนดสถานะการ disabled ให้กับ button โดยไม่สามารถใช้ได้กับ type ประเภท link
( default value คือ false )
example:var attributes = { disabled: false, type: "push" };
var button = new YAHOO.widget.Button ( "button", attributes );
-
config:focusmenu
value:boolean
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนดสถานะการ ได้รับ focus ให้กับ button
( default value คือ true )
example:var attributes = { focusmenu: true, type: "link" };
var link_button = new YAHOO.widget.Button ( "button", attributes );
-
config:href
value:String
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด href ให้กับ button โดยสามารถใช้ได้กับ type ประเภท link เท่านั้น
example:var attributes = { type: "link", href: "http://www.bamboolabcode.com" };
var link_button = new YAHOO.widget.Button ( "button", attributes );
-
config:label
value:string
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด label ให้กับ button
( default value คือ null )
example:var attributes = { type: "link", href: "http://www.bamboolabcode.com", label: "website" };
var link_button = new YAHOO.widget.Button ( "button", attributes );
-
config:lazyloadmenu
value:boolean
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด lazyloadmenu ให้กับ button โดยสามารถใช้ได้กับ type ประเภท menu เท่านั้น
( default value คือ true )
example:var optionMenu =
[
{ text: "Option 1", value: "menubutton-4-1" },
{ text: "Option 2", value: "menubutton-4-2" },
{ text: "Option 3", value: "menubutton-4-3" }
];
var attributes = { type: "menu", menu: optionMenu, lazyloadmenu: false };
var button_menu = new YAHOO.widget.Button ( "menubutton", attributes );
-
config:menu
value:YAHOO.widget.Menu, YAHOO.widget.Overlay, HTMLElement, String คือ id ของรายการที่ต้องการ, Array
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด รายการของเมนู ให้กับ button โดยสามารถใช้ได้กับ type ประเภท menu เท่านั้น
( default value คือ null )
example:var optionMenu =
[
{ text: "Option 1", value: "menubutton-4-1" },
{ text: "Option 2", value: "menubutton-4-2" },
{ text: "Option 3", value: "menubutton-4-3" }
];
var attributes = { type: "menu", menu: optionMenu, lazyloadmenu: false };
var button_menu = new YAHOO.widget.Button ( "menubutton", attributes );
-
config:menualignment
value:Array
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด menualignment ให้กับ button
( default value คือ ["tl", "bl"] )
example:var attributes = { type: "push", label: "bamboolabcode", menualignment: ["tr", "br"] };
var button = new YAHOO.widget.Button ( "button", attributes );
-
config:menuclassname
value:string
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด classname ให้กับ button
( default value คือ yui-button-menu )
example:var attributes = { type: "push", menuclassname: "bamboo-button-menu" };
var button = new YAHOO.widget.Button ( "button", attributes );
-
config:menumaxheight
value:number
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด ความสูงสูงสุดของ menu ให้กับ button
( default value คือ 0 )
example:var optionMenu =
[
{ text: "Option 1", value: "menubutton-4-1" },
{ text: "Option 2", value: "menubutton-4-2" },
{ text: "Option 3", value: "menubutton-4-3" }
];
var attributes = { type: "menu", menu: optionMenu, menumaxheight: 240 };
var button_menu = new YAHOO.widget.Button ( "menubutton", attributes );
-
config:menuminscrollheight
value:number
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด ความสูงอย่างน้อยของ menu ให้กับ button
( default value คือ 90 )
example:var optionMenu =
[
{ text: "Option 1", value: "menubutton-4-1" },
{ text: "Option 2", value: "menubutton-4-2" },
{ text: "Option 3", value: "menubutton-4-3" }
];
var attributes = { type: "menu", menu: optionMenu, menuminscrollheight: 150 };
var button_menu = new YAHOO.widget.Button ( "menubutton", attributes );
-
config:name
value:string
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด name ให้กับ button
( default value คือ null )
example:var attributes = { type: "push", name: "submit_button" };
var button = new YAHOO.widget.Button ( "button", attributes );
-
config:onclick
value:Object
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด เหตุการณ์ที่จะให้เกิดขึ้นเมื่อมีการ click ที่ button
( default value คือ null )
example:function onButtonClick ( )
{
alert ( "Click Button !!" );
}
var onClick = { fn: onButtonClick }
var attributes = { type: "push", name: "submit_button", onclick: onClick };
var button = new YAHOO.widget.Button ( "button", attributes );
-
config:replaceLabel
value:boolean
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด replaceLabel ให้กับ button
( default value คือ false )
example:var attributes = { type: "push", name: "submit_button", replaceLabel: true };
var button = new YAHOO.widget.Button ( "button", attributes );
-
config:tabindex
value:number
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด tabindex ให้กับ button
( default value คือ null )
example:var attributes = { type: "push", name: "submit_button", tabindex: 1 };
var button = new YAHOO.widget.Button ( "button", attributes );
-
config:target
value:string
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด target ให้กับ button ( สามารถใช้ได้กับ type แบบ link เท่านั้น )
example:var attributes = { type: "link", href: "http://www.bamboolabcode.com", label: "website", target: "_blank" };
var link_button = new YAHOO.widget.Button ( "button", attributes );
-
config:title
value:string
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด title ให้กับ button
( default value คือ null )
example:var attributes = { type: "link", href: "http://www.bamboolabcode.com", label: "website", title: "website" };
var link_button = new YAHOO.widget.Button ( "button", attributes );
-
config:type
value:string
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด type ให้กับ button
( default value คือ push )
( ค่าที่เป็นไปได้ ได้แก่ push, link, submit, reset, checkbox, radio, menu, split )
example:var attributes = { type: "link", href: "http://www.bamboolabcode.com" };
var link_button = new YAHOO.widget.Button ( "button", attributes );
-
config:value
value:Object
content:เป็น configuration attribute ของ button
โดยจะใช้กำหนด value ให้กับ button
( default value คือ null )
example:var attributes = { type: "link", href: "http://www.bamboolabcode.com", value: "10s" };
var link_button = new YAHOO.widget.Button ( "button", attributes );