forked from tsai/budibase
3 changed files with 31 additions and 1 deletions
@ -0,0 +1,12 @@ |
|||
export const booleanRenderer = (params) => { |
|||
const toggle = (e) => { |
|||
params.value = !params.value |
|||
params.setValue(e.currentTarget.checked) |
|||
} |
|||
let input = document.createElement("input") |
|||
input.type = "checkbox" |
|||
input.checked = params.value |
|||
input.addEventListener("click", toggle) |
|||
|
|||
return input |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
// https://www.ag-grid.com/javascript-grid-value-setters/
|
|||
// These handles values and makes sure they adhere to the data type provided by the model
|
|||
export const number = (params) => { |
|||
console.log('Params: ', params) |
|||
console.log('New Value: ', parseFloat(params.newValue)) |
|||
params.data[params.colDef.field] = parseFloat(params.newValue); |
|||
return true; |
|||
} |
|||
Loading…
Reference in new issue