updated extended-listbox to 2.0.0 (#14879)

This commit is contained in:
Christian Kotzbauer
2017-03-09 23:38:54 -08:00
committed by Mohamed Hegazy
parent a971970e93
commit 8d1cf56e25
2 changed files with 2 additions and 89 deletions
+1 -53
View File
@@ -1,5 +1,4 @@
/// <reference types="jquery" />
var $test = $("#test");
@@ -126,54 +125,3 @@ instance.onItemEnterPressed((event: ListboxEvent) => {
instance.onItemDoubleClicked((event: ListboxEvent) => {
console.log(event.args);
});
/////// LEGACY API ///////
// Add string item
instance.target.listbox("addItem", "Test2");
// Add item
var item: ListboxItem = <ListboxItem>{};
item.selected = true;
item.disabled = false;
item.childItems = ["Test4"];
item.groupHeader = false;
item.id = "ouetioreit";
item.index = 0;
item.text = "Test3";
var id: string = instance.target.listbox("addItem", item);
// Remove item
instance.target.listbox("removeItem", id);
// Get item
var i: ListboxItem = instance.target.listbox("getItem", id);
// Get items
var allItems: ListboxItem[] = instance.target.listbox("getItems");
// Move item up
var newIndex: number = instance.target.listbox("moveItemUp", i.id);
// Move item down
newIndex = instance.target.listbox("moveItemDown", i.id);
// Clear selection
instance.target.listbox("clearSelection");
// Enable
instance.target.listbox("enable", false);
// Destroy
instance.target.listbox("destroy");
+1 -36
View File
@@ -1,10 +1,8 @@
// Type definitions for extended-listbox 1.1.x
// Type definitions for extended-listbox 2.0.x
// Project: https://github.com/code-chris/extended-listbox
// Definitions by: Christian Kotzbauer <https://github.com/code-chris>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="jquery" />
interface ListboxItem {
/** display text */
text?: string;
@@ -147,37 +145,4 @@ interface JQuery {
/** constructs a new instance of Listbox on the given DOM item */
listbox(options: ListBoxOptions): ExtendedListboxInstance|ExtendedListboxInstance[];
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: 'addItem'): string;
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: 'removeItem'): void;
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: 'destroy'): void;
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: 'getItem'): ListboxItem;
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: 'getItems'): ListboxItem[];
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: 'moveItemUp'): number;
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: 'moveItemDown'): number;
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: 'clearSelection'): void;
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: 'enable'): void;
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: string): any;
/** @deprecated: use method in ExtendedListboxInstance */
listbox(methodName: string, methodParameter: any): any;
}