// Type definitions for paramquery Grid
// By: Paramvir Dhindsa
// Project: http://paramquery.com/
///
///
declare global{
interface JQueryStatic{
active
paramquery
}
interface JQuery{
pqGrid(options: pq.gridT.options| string): any
pqGrid(method: string, param: any): any
}
}
declare module pq {
namespace gridT{
type numberorstring = number|string;
type colModel = Array;
type crule = {
condition?: string
value?
value2?
}
type rule = {
dataIndx: numberorstring,
condition?: string,
value?,
value2?,
mode?: string,//5.2.0
crules?: Array< crule> //5.2.0
}
interface column{
/** alignment of content in cells */
/** "left", "center" or "right" */
align?: string
//v7.0.0
attrHead?: {
title?: string
}
/** properties of a checkbox column */
cb?: {
all?: boolean
check?: any
header?: boolean
maxCheck?: number //5.3.0
select?: boolean
uncheck?: any
}
/** dataIndx of linked checkbox column */
cbId?: numberorstring //5.2.0
/** Class to be assigned to whole column including header. */
cls?: string
/** Class to be assigned to header. */
clsHead?: string //5.2.0
/** collapse properties for parent grouped columns */
collapsible?: {
/**last child of grouped column is visible instead of first column in collapsed state. */
last?: boolean
/**true when collapsed, false when expanded */
on?: boolean
}
/** nesting of colModel used for grouping of columns */
colModel?: colModel
/** When set to false, this option prevents a column from being copied to the clipboard or exported data */
copy?: boolean
/** fieldname used for data binding */
dataIndx?: string | number
/** data type of the column "bool" | "date" | "float" | "html" | "integer" | "string" | "stringi" */
dataType?: string
deFormat?: ((any) => any) //5.3.0
/**deny actions in toolPanel */
denyAgg?: boolean
denyGroup?: boolean
denyPivot?: boolean
/** controls editability of whole column */
editable?: boolean|((evt, ui: cellObject) => boolean)
/** editing behaviour for a column and it overrides the global editModel properties. */
editModel?: {
keyUpDown?: boolean
saveKey?: string
onBlur?: string
cancelBlurCls?: string
onTab?: string
}
editor?: editorObj | ((ui: cellObject) => editorObj) | boolean
exportRender?: boolean
filter?: {
attr?: string
//cache?: boolean
cls?: string
//condition?: string | ((val: any, match: any) => boolean)
//condition?: string //5.2.0
conditionExclude?: Array//5.2.0
conditionList?: Array//5.2.0
conditions?: {//5.2.0
[condition: string]:{
compare: (cellData, value, value2) => boolean
}
}
crules?: Array//5.2.0
diExtra?: Array //5.3.0
dpOptions?: object //5.2.0
dpOptions2?: object //5.2.0
format?: string | ((any) => any) //5.3.0
gridOptions?: object //5.2.0
groupIndx?: numberorstring
init?: (ui:any)=>any
labelIndx?: numberorstring
listener?: any
listeners?: any[]
maxCheck?: number //5.3.0
menuIcon?: boolean //5.2.0
mode?: string //5.2.0
//type?: string
//subtype?: string
//prepend?: any
options?: any|any[]
selectGridCreated?: (ui: object) => void //5.2.0
selectGridObj?: (ui: object) => void //5.3.0
style?: string
//value?: any
//value2?: any
valueIndx?: numberorstring
}
filterFn?: (ui: object) => object //5.2.0
format?: string | ((any) => any) //5.3.0: callback
formatRaw?: string //5.3.0
formula?: (ui: {rowData: any}) => any
groupable?: boolean
groupChange?: ((val: string) => string)
halign?: "left" | "center" | "right"
hidden?: boolean
//7.0
hvalign?: "top" | "center" | "bottom"
maxWidth?: string | number
menuIcon?: boolean //5.2.0
menuUI?: any //5.2.0
menuInClose?: boolean //5.2.0
menuInDisable?: boolean //5.2.0
menuInHide?: boolean //5.2.0
minWidth?: string | number
nodrag?: boolean
nodrop?: boolean
parent?: column
/** When set to false, this option skips paste of data on a column */
paste?: boolean //8.0.0
pivotSortFn?: ((a:object, b:object) => number) //5.4.0
//v7.0.0
/*prop?: {
align?: string
valign?: string
}*/
postRender?: (string | ((ui: cellObject) => void ))
render?: (string | ((ui: renderObj) => string | {
attr?: string
cls?: string
style?: string
text?: string
}))
//v7.0.0
/*renderHead?: ((ui: renderObj) => string | {
attr?: string
cls?: string
style?: string
text?: string
})*/
renderLabel?: ((ui: renderObj) => string | void) //5.3.0
resizable?: boolean
showifOpen?: boolean //5.3.0
sortable?: boolean
sortType?: ((rowData1: any, rowData2: any, dataIndx: any) => number)
style?: object//7.0
styleHead?: object //7.0
summary?: {
edit?: boolean
/** "avg" | "count" | "min" | "max" | "sum" | "stdev" | "stdevp" */
type?: string
}
title? : string | ((ui:any)=> string)
tpCls?: string
tpHide?: boolean
type?: string
useLabel?: boolean //5.3.0
validations?: Array<{
icon?: string
type: any
value?: any
msg?: string
warn?: boolean
}>
//7.0
valign?: "top" | "center" | "bottom"
width?: number | string
}
type filterModel = {
//clear?: boolean
header?: boolean
hideRows?: boolean //6.2.0
menuIcon?: boolean //5.2.0
mode?: "AND" | "OR"
on?: boolean
timeout?: number
type?: 'local' | 'remote'
}
interface editorObj{
type?: any
init?: ((ui:any)=>any)
prepend?: any
options?: any[]
labelIndx?: string | number
valueIndx?: string | number
groupIndx?: string | number
dataMap?: any[]
mapIndices?: any
getData?: ((ui) => any)
cls?: string
select?: boolean
style?: string
attr?: string
}
interface rowObject{
rowData?: any
rowIndx?: number
rowIndxPage?: number
}
interface colObject{
colIndx?: number
column?: column
dataIndx?: string | number
}
interface cellObject extends rowObject, colObject{
}
interface renderObj extends cellObject{
cellData: any
Export: boolean
formatVal: string
}
interface pageModel{
bubble?: boolean
curPage?: number
format?: string //7.4.0
layout?: Array //5.2.0
rPPOptions?: Array | Array