added: ThingyRecord allows you to sell records in a Thing (like a classified ad)
This commit is contained in:
parent
724675c71c
commit
6d20e7f5df
12 changed files with 1014 additions and 8 deletions
32
www/extras/yui-webgui/build/thingyRecord/thingyRecord.js
vendored
Normal file
32
www/extras/yui-webgui/build/thingyRecord/thingyRecord.js
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
// Requires YUI Connection and JSON
|
||||
|
||||
if ( typeof WebGUI == "undefined" ) {
|
||||
WebGUI = {};
|
||||
}
|
||||
if ( typeof WebGUI.ThingyRecord == "undefined" ) {
|
||||
WebGUI.ThingyRecord = {};
|
||||
}
|
||||
|
||||
WebGUI.ThingyRecord.getThingFields
|
||||
= function ( thingId, elementId ) {
|
||||
|
||||
// Callback to populate the form element
|
||||
var callback = {
|
||||
success : function (o) {
|
||||
var el = document.getElementById(elementId);
|
||||
while ( el.options.length >= 1 )
|
||||
el.remove(0);
|
||||
var fields = YAHOO.lang.JSON.parse( o.responseText );
|
||||
for ( var key in fields ) {
|
||||
el.options[el.options.length]
|
||||
= new Option( fields[key], key, 1, 1 );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var url = '?op=formHelper;class=ThingFieldsList;sub=getThingFields;thingId='
|
||||
+ thingId
|
||||
;
|
||||
YAHOO.util.Connect.asyncRequest( 'GET', url, callback );
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue