51 lines
832 B
JavaScript
51 lines
832 B
JavaScript
|
|
(function($){
|
|
|
|
$.extend($, { sky: {} } );
|
|
$.extend($.sky, { controls: {} });
|
|
|
|
function IPPool_create(){
|
|
|
|
}
|
|
|
|
|
|
$.fn.IPPool = function( opts ){
|
|
alert(this);
|
|
var select = this.find("select")[0];
|
|
|
|
if (!select)
|
|
throw "IPPool needs an <select> element to be instantiated on";
|
|
|
|
alert(select);
|
|
|
|
}
|
|
|
|
|
|
me = function(opts){
|
|
return this.filter("select").map( function(){
|
|
var ctrl = this;
|
|
var pools = skyapi().getJson("/DHCP/collections/IPPool");
|
|
|
|
pools.forEach( function(e){
|
|
$("<option></option>")
|
|
.attr("value", e.Name)
|
|
.text( e.Name )
|
|
.appendTo( ctrl );
|
|
} );
|
|
ctrl.val = function(v){ alert(v); }
|
|
|
|
return ctrl;
|
|
});
|
|
}
|
|
|
|
$.sky.controls.IPPool = function(type,key){
|
|
return $("<select></select>").IPPool().attr( "id", key );
|
|
};
|
|
|
|
|
|
|
|
|
|
}( jQuery ));
|
|
|
|
|