General purpose library for the ZPM.Net framework.
Parameter methodUrl is the server method being called. This is only used to display a message if timeout occurs (server doesn't respond)
Parameter waitSeconds (optional, default is 30) is how many seconds to wait for an ajax call to the server to respond.
This function will will inhibit user input, display a busy spinner and calls .AjaxCallbackCheck() every 100 milliseconds until all ajax calls have completed. See Internal below.
Used by zpm.ErrorDialog(). Adds a div to the current page for use by jQuery .dialog().
returns empty string (blank) if parameter str is null.
Returns a string, in the format MM/DD/YYYY if the date is valid, otherwise "". Parameter dt can be ""(blank), null, a javascript date, a json date
Returns string representation of a number.
If num is zero or null, returns "".
If decimals is not specified, returns num.toString() (floating decimal point).
If decimals is specified, returns num.toFixed() where the string has a fixed number of decimal positions.
If parameter i is '' or null, returns 0.
if parameter i is an invalid number, returns null.
If parameter i is '' or null, returns 0.
if parameter i is an invalid number, returns null.
If parameter decimals is specified, the number returned is rounded to the number of decimals specified.
Parameter n is a string.
Returns true if n can be converted to a number.
Parameter $element is a jQuery selector of a table row.
Parameter $container is a jQuery selector of a table.
ScrollIntoView() will scroll the table so the row is visible.
Returns an integer array build from the string arrry strArray.
Parameter strArray is a string array. All values in strArray are assumed to be valid numbers (no checking is performed).
Parameter name is a file name (string).
Returns empty string if parameter name doesn't contain invalid characters.
If invalid characters are found it returns an error message.
dateFormat: "mm/dd/yy"
onSelect: this.DatePickerOnSelect - call this zpm method when a date is selected
showOtherMonths: true
selectOtherMonths: true
beforeShow: this.DatePickerBeforeShow - call this zpm method before showing the Datepicker pop-up.
Used internally by DatePicker.
Used internally by DatePicker.
Parameter $tbl is a jQuery selector of a table with a heading row.
The first row of the table must be a heading row with th elements that are modified such that the heading row is fixed
and will not move vertically when the table is scrolled.
Any styling must be applied to an inclosed div and not to the th element. For example, <th style="color:blue">Title</th>
must be changed to <th><div style="color:blue">Title</div></th>
If table data is changed after calling FixedHeading(), call FixedHeadingAlign() to realign headings with data.
Parameter $tbl is a jQuery selector of a table with a heading row.
Call this function after rows or cells for a table have changed to realign the heading with data rows.
FixedHeading() must have already been called on this table.
Used internally by FixedHeading. FixedHeadingScroll() is called whenever the table is scrolled horzontally.
Used internally by FixedHeading.
Used internally by FixedHeading.
Sorts a table by the heading column clicked on. If the table is already sorted on that column,
it toggles assending/desending order.
Parameter th - th element user clicked on.
Parameter fnSort - optional, function to use for sorting column th. The default function is RowTextCompare().
Heading cell should look like: <th onclick="zpm.TableSort(this);">Customer Name</th>.
Use zpm.TableSort(this, myFunction) to customize sorting (see RowTextCompare()).
TableSort assumes rows are presorted by the first column, in assending order. Call this function to alter that assumption.
Parameter $table - jQuery selector to the table.
Parameter columnIndex - index (first one is 0) of the column the table is sorted by when initially loaded by the application.
Parameter assending - true if initially sorted assending, or false for desending.
Call this function to resort the table after a change to the rows or columns.
It will resort the table according to the default or last sort.
Parameter $table - jQuery selector to the table.
Used by TableSort() to sort text data.
Use this as a template to sort numbers, dates or for custom sorting.
Returns -1 if a<b, 0 if a=b, 1 if a>b.
Extends the javascript Number class.
Parameter decimals - number of decimal positions in formatted output.
Converts number to string with commas and fixed number of decimals.
Usage: var n = 123.99; var text = n.numberWithCommas(2);
Extends the javascript String class.
This is the same as string.replace, except it replaces all occurances, not just the first one.
Extends the javascript String class.
Parameter len - length of the returned string.
Parameter c - (optional) character to pad the string with. Default is a space
Returns a string padded on the left to length len with character c.
Extends the javascript String class.
Parameter len - length of the returned string.
Parameter c - (optional) character to pad the string with. Default is a space
Returns a string padded on the right to length len with character c.
This is used by .AjaxCallbackTimer(), and should not be called directly. It checks to see if all ajax calls have completed and updates the seconds counter. If all ajax calls have completed, it closes the busy spinner and restores user input.