Closed ImageDeeply closed 2 months ago
@ImageDeeply Thanks for the report. I could run the following example:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="/src/brython.js"></script>
<link href="https://unpkg.com/tabulator-tables@6.2.5/dist/css/tabulator.min.css" rel="stylesheet" crossorigin="anonymous">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@6.2.5/dist/js/tabulator.min.js" crossorigin="anonymous"></script>
</head>
<body>
<div id="example-table-py"></div>
<script type="text/python" debug="3">
from browser import window
def foopy(headerValue, rowValue, *args):
return rowValue > 20
window.Tabulator.extendModule('filter', 'filters', {'foopy': foopy})
tabledata = [
{'id':1, 'name':"Billy Bob", 'age':12, 'dob':"14/05/2010"},
{'id':2, 'name':"Jenny Jane", 'age':42, 'dob':"30/07/1954"},
{'id':3, 'name':"Steve McAlistaire", 'age':35, 'dob':"04/11/1982"}
]
# define table
table = window.Tabulator.new("#example-table-py", {
'data': tabledata,
'autoColumns': True
})
def onbuilt(*args):
table.setFilter('age', 'foopy')
table.on('tableBuilt', onbuilt)
</script>
</body>
</html>
Tabulator is a cool library, so thanks for taking the time to create a specific test script to check the fix.
Brython is working very well for us. Your persistence over the years is amazing.
is extendModule implemented? If not, is there a workaround
Error:
Brython:
this works in js: