SilkBuilder
  • SilkBuilder
  • Development Environment
    • Development Environment
    • System Elements
    • Project, Data Model and ORM
    • Development Formats
  • Silk Builder Training
    • Sample Database
    • Plain Application
    • Easy Application
    • Simple Application
    • Complex Application
    • Report Application
    • System Environment
  • Docs
    • The ORM Structure
    • SilkBuilder
    • Silk Service
    • Java Database Class
    • Report
  • Silk Tags
    • App
    • AppHeader
    • Button
    • ButtonItem
    • Chart
    • Column
    • Content
    • DataProvider
    • DataService
    • Form
    • Group
    • Header
    • HelpBox
    • If
    • Input
    • JQcode
    • JScode
    • LogicAction
    • LogicDimension
    • LogicGrid
    • Modal
    • ModalBody
    • ModalFooter
    • Module
    • Page
    • Pagination
    • Screen
    • ScreenFooter
    • ScreenHeader
    • Tab
    • TabItem
    • Table
    • TableBody
    • TableHeader
    • TabsNav
    • Tile
  • JavaScript Objects
    • Button
    • ChartJS
    • Column
    • DataProvider
    • EventManager
    • Form
    • Input
    • Modal
    • Pagination
    • SilkPage
    • Table
    • TabsNav
    • Tile
    • Utility Functions
  • Coding Techniques
    • Data Trees
    • Pagination
    • Mark Deleted
    • Record Sync
    • Filtering Code
    • Content Template
    • Sort Data Columns
    • Form Input File
    • Button with Confirmation
    • Toggle List
    • Table Inputs
Powered by GitBook
On this page
  • callFunction(fnString) ⇒ Object
  • dateToString(date) ⇒ String
  • doesFileExist(urlToFile) ⇒ Boolean
  • downloadText()
  • getFormattedValue(value, formatter) ⇒ String
  • getNumber(value, precision) ⇒ Number
  • getObjectType(obj) ⇒ String
  • getRandomColor() ⇒ String
  • getTemplateData(template, index, item, renderer) ⇒ String
  • getToday() ⇒ Date
  • getTodayString()
  • getUUID() ⇒ String
  • ifTag($container)
  • ifUndefined(value, option) ⇒ Object
  • inIframe() ⇒ Boolean
  • isEmpty(object) ⇒ Boolean
  • isIn() ⇒ Boolean
  • isNotEmpty(object) ⇒ Boolean
  • isNumeric()
  • isRunningStandalone() ⇒ Boolean
  • left(str, n) ⇒ String
  • renderCode() ⇒ String
  • replaceAll(target, search, replace) ⇒ String
  • right(str, n) ⇒ String
  • roundNumber(value, precision) ⇒ Number
  • sanitize(text) ⇒ String
  • stringToDate(stringDate) ⇒ Date
  1. JavaScript Objects

Utility Functions

callFunction(fnString) ⇒ Object

Calls and executes the provided function's name without parameters.

Kind: global function

Param
Type
Description

fnString

String

The function's name

dateToString(date) ⇒ String

Convert a Date object to the SIK string-date with formar "YYY-MM-DD HH:MM:SS.MMS". Sample: "2022-09-09 09:40:43.226". The Silk ORM returns and received date data in this format.

Kind: global function

Param
Description

date

The Date object to be converted

doesFileExist(urlToFile) ⇒ Boolean

Verifies is the URL of a resource file exist or is accesible in host server.

Kind: global function

Param
Description

urlToFile

The file' URL.

downloadText()

Function to download the provided text into a file.

Kind: global function

getFormattedValue(value, formatter) ⇒ String

Formats the value to specify pattern.

Kind: global function

Param
Type
Description

value

Object

The value to get formated

formatter

String

The formating pattern or template

getNumber(value, precision) ⇒ Number

Converts any provided value into a number.

Kind: global function

Param
Default
Description

value

The value to be converted to a number.

precision

2

The decimal places.

getObjectType(obj) ⇒ String

Return the type of the object.

Kind: global function

Param
Description

obj

The object to evaluate.

getRandomColor() ⇒ String

Returns the HEX value of ransom color.

Kind: global function

getTemplateData(template, index, item, renderer) ⇒ String

Replaces the columns, enclosed with "{" or ""{{", found in a provided template with the attributes found in the the provided item. Then apply a renderer if provided. Some templates: {row-index} - Renders the row number starting with 1. Usually use to display the row number in a table. {dp-inded} - Renders the data provider index used when building the row. {ms-value} - Render the current milliseconds. Usually used as a unique variable when displaying images.

Kind: global function

Param
Type
Description

template

String

The string containing the columns to replace.

index

Integer

The index position in the list

item

Objet

The object containing the attributes to be used to replace.

renderer

String

The function to be used as data renderer.

getToday() ⇒ Date

Return the current date and time

Kind: global function

getTodayString()

Return the current date and time in silk's string format.

Kind: global function

getUUID() ⇒ String

Generates a UUID Value.

Kind: global function

ifTag($container)

Evaluates HTML tags for silk-if css classes in the provided JQuery object. If tags found evaluates the attribute data-if criteria to keep or remove the tag.

Kind: global function

Param
Type
Description

$container

Object

JQuery object to evaluate. if undefined evaluates all the html document

ifUndefined(value, option) ⇒ Object

Analyzes if the provided value is undefined or null. If tyes it return the provided option.

Kind: global function

Param
Description

value

The value to evaluate.

option

The option to return if the value is undefined or null.

inIframe() ⇒ Boolean

Verifies if a web application is running inside an iframe

Kind: global function

isEmpty(object) ⇒ Boolean

Returns true if the object is undefined or null or empty.

Kind: global function

Param
Description

object

The object to evaluate.

isIn() ⇒ Boolean

Function to verify if the first parameter matches the other parameter values. The second parameter can be an array. It is not extrict compparizon.

Kind: global function

isNotEmpty(object) ⇒ Boolean

Returns true if the object is not undefined or null or empty.

Kind: global function

Param
Description

object

The object to evaluate.

isNumeric()

Return if the string is a number

Kind: global function

isRunningStandalone() ⇒ Boolean

Verifies if the web application is running standalone (PWA)

Kind: global function

left(str, n) ⇒ String

Returns a string with the provided number of characters starting from the left.

Kind: global function

Param
Description

str

The string to operate

n

The number of character to return

renderCode() ⇒ String

Takes code text and replaces the tabs with hard spaces and in lines.

Kind: global function

Type
Description

String

The code to format

replaceAll(target, search, replace) ⇒ String

Function replaceAll to replace all the existing string to a new one.

Kind: global function

Param
Description

target

The text to operate

search

The text to search

replace

The replacement text

right(str, n) ⇒ String

Returns a string with the provided number of characters starting from the right.

Kind: global function

Param
Description

str

The string to operate

n

The number of character to return

roundNumber(value, precision) ⇒ Number

Rounds a number to the provided decimal place

Kind: global function

Param
Default
Description

value

The number to be rounded.

precision

0

The rounding decimal place.

sanitize(text) ⇒ String

Cleans data from HTML tags.

Kind: global function

Param
Type
Description

text

String

The text to sanitize.

stringToDate(stringDate) ⇒ Date

Convert a SILK string-date data to data object. The string should have the formar "YYY-MM-DD HH:MM:SS.MMS". Sample: "2022-09-09 09:40:43.226". The Silk ORM returns and received date data in this format.

Kind: global function

Param
Description

stringDate

The SILK string-date value to be converted.

PreviousTileNextCoding Techniques

Last updated 1 day ago