Append children created by html code to the end of the selected element
a existing element or a string that will find a element by id
html code for creating new elements
the first of the created elements or undefined if none created
Change the color of the button by first remove all btn- + primary, danger, warning, success and info classes then add the new class or classes and change the text if you want as well
buttonid or button to change
array classes or a single class string to remove extra
array classes or a single class string to add
Optionaltext: string
to be added to button instead of the one already there if parameter used
Clear the error element defined by errorid if active defined by errortoelement
Create new element from html code
html code
elements created from the html
Create a checkbox with a changable class set that can be used for event that will be used for select and deselect single or all depening on the value set
function needed to be implemented is onchangecheckbox(event)
Optionalvalue: string
if not set use path as value
Delete definition for a table
Name of table definition to delete
json with result telling how it went
Get definition for a single table (tdf)
Name of the table to get definition for
json with result 'ok' and tdf object
Create definition for a single table (tdf)
Name of table to create definition for
Table definition object to post
json with result telling how it went
Update definition for a single table (tdf)
Name of table to update definition for
Table definition object to update
json with result telling how it went
Do a DELETE request to the url and return the json object
an url that is allowed to use
a real object from call to server or a {result: 'error', error: message}
Do a GET request to the url and return the json object
an url that is allowed to use
a real object from call to server or a {result: 'error', error: message}
Do a POST request to the url and return the json object
an url that is allowed to use
a object that will be stringified to send
a real object from call to server or a {result: 'error', error: message}
Do a PUT request to the url and return the json object
an url that is allowed to use
a object that will be stringified to send
a real object from call to server or a {result: 'error', error: message}
Find one HtlmElement
a existing element or a string that will find a element by id
Optionalselector: string
uses to find a element inside the element found by elmid
HtmlElement or null
Add or remove color classed on an element. Used to change colors to elements that have a prefix. Ex. btn-danger or text-success The prefix will be added to any classes given if no - in class name so you can use warning instead of btn-warning on a button
By default primary, danger, warning, success and info is always removed before any add
element id or the element to change
A prefix to use for the classes like btn-
array of classes or single class to remove or undefined if not used, if no - in name prefix will be added
array of classes or single class to add or undefined if not used, if no - in name prefix will be added
Optionaltext: string
to be added to button instead of the one already there if parameter used
Get 0 or more elements from selector(s) or element and selector
existing element to be queried for children or a selector for selecting elemenets
Optionalsel2: stringlist of Elements or null
Find attribute on element or on the first child that have this attribute and return the value
an existing element or a string that will find a element by id
name of the attribure to find
attribute or null
element id or the element to start from
a name of html type in lower case
array of two elements where the first is the element matching the localname type or null and the second how many levels up from the start did we have to go
function tablecellonclick(event){
const [td, level] = this.findfirstparentoftype(event.target, 'td');
if (td){
// ... do something with table cell
}
}
will find first td up in tree from the event.taget calling it
Check for attribute on element or children and return the first element having the attributre defined
an existing element or a string that will find a element by id
name of the attribure to find
element with attributre defined or null
Return a attribute value if it exists
an existing element or a string that will find a element by id
attribute name
attribute value or blank string
Return a attribute value if it exists
an existing element or a string that will find a element by id
attribute name
if set to true a null will be returned for not found
attribute value or blank or null depending on nullonnotfound
Hide a element by adding d-none class
an existing element or a string that will find a element by id
the element or null
Get inner htlm to or from a element
a existing element or a string that will find a element by id
the inner htlm of the element or null if element not found
Set inner htlm to an element
a existing element or a string that will find a element by id
if given a string, it will be set to the element
null if element not found or the element if code set
Test if a instance is a real array and not object or null
to test
true if real array
Give to strings in the form of semantic versioning and tell if the first is newer than the second Support any type version as long as they are seperated by the same number of . Ex. 0.1.0 and 0.1.1 gives false Ex. 9.0.0.2992 and 9.0.0.2990 gives true Ex. 9.1.0.0 and 9.0.0.2990 gives true as well
version to check
version to check against
true or false
Test if a instance is a real object and not array or null
to test
true if real object
Login to the server with username and password
return json with how it went
Check if you are logged in to the server
return json with isloggedin, level, username and result ok. if you are using basic or token you will get result denied
Logout current browser session on server
Call a method when element selected is changed
an existing element or a string that will find a element by id
a method in the class extended on this class
Call a method when element selected is clicked
an existing element or a string that will find a element by id
a method in the class extended on this class
Call a method when element get the named event. This method if for handleing all events that not are so commonly used that they have got their own method like onclickme
an existing element or a string that will find a element by id
the name for the event to register ex input, focusin, focusout
a method in the class extended on this class
Call this function when document have finished loading
a function to run
Delete one record in a table on dataease server
Name of the table to find record in
he query to find the record as any DataEase queries
Optionalrecno: string | number
Leave blank for first match or set the record number you want starting on 0
jdata json with result telling how it went (values ok, denied or error), if ok it returns recno that was deleted
Read on record from a table on dataease server
Name of the table to find record in
The query to find the record as any DataEase queries
Optionalrecno: string | number
Leave blank for first match or set the record number you want starting on 0
jdata json with result telling how it went (values ok, denied or error), if ok recorddata as requested, if error there will be a message
Create a new record
Name of the table to find record in
a object containing all data needed to create a record
jdata json with result telling how it went (values ok, denied or error), if ok a recorddata with changed vales are returned, if error there will be a message
Read records from a table on dataease server
Name of the table to find records in
The query to find the records as any DataEase queries
Optionalrecnostart: string | number
Leave blank for starting on 0 or set the record number you want starting on
Optionalrecnoend: string | number
The end record to fech. Leave blank means recnostart + 100 or set the record number you want to be the last to fetch
jdata json with result telling how it went (values ok, denied or error), if ok listdata as requested, if error there will be a message
Read records from a table on dataease server
Name of the table to find records in
an array of a object containing the data you want to change
jdata json with result telling how it went (values ok, denied or error), if ok recorddata as requested, if error there will be a message
Update existing records in a table on dataease server
Name of the table to update records in
The query to find the records to update as any DataEase queries
an array of a object containing the data you want to change. Update starts on first object and continue as long as you have data or are stopped by recnoend. The recnostart and recnoend has nothign to do with where you start in the data.
Optionalrecnostart: string | number
Leave blank for starting on 0 or set the record number you want starting on
Optionalrecnoend: string | number
The end record to update. Leave blank means all data you have sent or set the record number you want to be the last to update
jdata json with result telling how it went (values ok, denied or error), if ok recorddata as requested, if error there will be a message
Update an exsiting record in a table
Name of the table to find record in
The query to find the record as any DataEase queries
a object containing the data you want to change in a record
Optionalrecno: number
Leave blank for first match or set the record number you want starting on 0
jdata json with result telling how it went (values ok, denied or error), if ok a recorddata with changed vales are returned, if error there will be a message
Remove children from the back of thil element till there is only the amount of to left
an existing element or a string that will find a element by id
Optionalto: number
hove many children to be left, default is 0 if not set
Run a execdql as high user or a server dql with security as set in document
dql/body to run, name can be @name, #number and *: for execdqls or plain names for server dqls. You can name a dql and body by dqlname/bodyname
Optionaldataentry: { [key: string]: string }
object with dataentry that can be used for dql, server dql can have any name, execdql only field1-4
jdata with result, if execdql with body the body can be found in jdata.data if jdata.result == 'ok'
Add a class to all selected elements
a selector that will match elements in the DOM
class name to add
Remove class from all selected elements
a selector that will match elements in the DOM
class name to remove
Send error to console and error element if defined To error element is defined by errorid and errortoelement To console is defined by errortoconsole
the result from call to deserver api or a string
Set a attribute value on a element or if value is null, remove it
an existing element or a string that will find a element by id
attribute name
a string value to set or null if you want to remove the attribute
element if found and attribute set or null if element not found or remove failed
Used by showerror for displaying a error dialog and to avoid a lot of extra code in the budlels we prefer to set it dynamically after creation of guitools. What is used is for now is bootstap.Modal
the bootstrap element set in window.bootstrap when loading bootrap.js in browser
For make a part of the page adjust to the resizing of the app
element id or the element to resize
Optionaladjust: number
default if 40 px at the bottom is left, you can use a different number by adding it here
Setup what server to load and store data from, it is usually same server as you load you application from
and in that case you can use location.port for the for and combine ${location.protocol}//${location.hostname}
to get the correct server address
the port used on development server or nothing if comming from default http or https ports
the base url to use including protocol ex. http://127.0.0.1 for you development server
Show a element by remove d-none class
an existing element or a string that will find a element by id
the element or null
Show the error modal that should be defined in the html a id="ErrorModal" Needs to be async to be able to dynamically load bootstrap if not already done
The title on top of error
The error message in dialog, can be text or html
Optionaladdcancelchain: boolean
show the chain cancel button or not
List all table names in application definition
json with result 'ok' and tables array
Change the color of the text by first remove all text- + primary, danger, warning, success and info classes then add the new class or classes and change the text if you want as well
element id or the element to change
array classes or a single class string to remove extra
array classes or a single class string to add
Optionaltext: string
to be added to button instead of the one already there if parameter used
Get value from element
an existing element or a string that will find a element by id
return the value of element as string or boolean if the element exists and null if not
Set value in element
an existing element or a string that will find a element by id
this is the value to set
it will return undefined if a value is set and null if element do not exist
A class for easy handling of apis the deserver gives