Javascript: Difference between revisions

From nuBuilderForte
Jump to navigation Jump to search
Line 342: Line 342:


=nuSubformObject=
=nuSubformObject=
{{Template:php_sprera
<!--Javascript SYNTAX, PARAMETERS, RETURN, EXAMPLE, RESULT ALSOSEE-->
|syntax=<!-- SYNTAX --><span style='color:#E4D00A'>
object  : nuSubformObject(string1);
</span>|parameters=<!-- PARAMETERS --><pre>
string1  : Subform Object id
</pre>|return=<!-- RETURN --><pre>
object  : contains all properties of a [[Objects#Subform|Subform]]
</pre>|description=<!-- DESCRIPTION -->
This returns a Javascript object that can be looped through.
This returns a Javascript object that can be looped through.
|example=<!-- EXAMPLE --><pre style="background-color:#f8dc3d">
JSON.stringify(nuSubformObject('zzzzsys_tab_sf'))
</pre>|result=<!-- RESULT --><pre>
{
  "id": "zzzzsys_tab_sf",
  "foreign_key": "syt_zzzzsys_form_id",
  "primary_key": "zzzzsys_tab_id",
  "object_id": "570b3915874d635",
  "table": "zzzzsys_tab",
  "action": "save",
  "rows": [
    [
      "56777715b87666e",
      "Main",
      "10",
      0
    ],
    [
      "s14986964108605",
      "Test",
      "20",
      0
    ],
    [
      "-1",
      "",
      "",
      1
    ]
  ],
  "edited": [
    [
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0
    ]
  ],
  "deleted": [
    0,
    0,
    1
  ],
  "fields": [
    "ID",
    "syt_title",
    "syt_order",
    "nuDelete"
  ]
}
</pre>|alsosee=<!-- SEE ALSO -->
|}}
=nuTotal=
=nuTotal=
Returns the value of a number Object.
Returns the value of a number Object.
=nuTranslate=
=nuTranslate=
Swaps a nuBuilder phrase with a phrase in [[Translations=.
Swaps a nuBuilder phrase with a phrase in [[Translations=.

Revision as of 03:31, 13 July 2017

nuAddAction

nuAddAction()

Parameters


Return Value


Description

If placed on an Object's click event, it will take the user to the Edit Form of a new record.

Example


nuDebug()



Also See : nuAddActionButton


nuAddActionButton

Add an Action Button.

nuBeforeSave

A function that can be created to validate an Edit Form before it is saved.

nuCloneAction

nuCloneAction()

Parameters


Return Value


Description

If placed on an Object's click event, it will make a copy of the current record ready to save.

Example


nuDebug()



Also See : nuAddActionButton


nuDeleteAction

nuDeleteAction()

Parameters


Return Value


Description

If placed on an Object's click event, it will will delete the current record.

Example


nuDebug()



Also See : nuAddActionButton


nuDisable

nuDisable(string1)

Parameters

string1  : Object id.

Return Value


Description

This will disable all parts of a nuBuilder Forte Object.

Example

nuDisable('cus_phone2');

nuDebug()



Also See : nuEnable


nuEmailReportAction

An Action Button that will send an email.

nuEnable

nuEnable(string1)

Parameters

string1  : Object id.

Return Value


Description

This will enable all parts of a nuBuilder Forte Object.

Example

nuEnable('cus_phone2');

nuDebug()



Also See : nuDisable


nuGetBreadcrumb

Go to a prevoius Breadcrumb and a certain Tab.

nuGetWordWidth

Returns the width of a string in pixels.

nuHide

nuHide(string1)

Parameters

string1  : Object id.

Return Value


Description

This will hide all parts of a nuBuilder Forte Object.

Example

nuHide('cus_phone2');

nuDebug()



Also See : nuShow


nuID

Creates a unique string.

nuMessage

Displays a message.

nuPad2

string = nuPad2(integer1)

Parameters

integer1  : number.

Return Value

string  : a string 2 characters wide.

Description

Adds 0's to the left of a number to a width of 2.

Example

console.log(nuPad2(7));

nuDebug()

07


Also See : nuPad3, nuPad4


nuPad3

string = nuPad3(integer1)

Parameters

integer1  : number.

Return Value

string  : a string 3 characters wide.

Description

Adds 0's to the left of a number to a width of 3.

Example

console.log(nuPad3(7));

nuDebug()

007


Also See : nuPad2, nuPad4


nuPad4

string = nuPad4(integer1)

Parameters

integer1  : number.

Return Value

string  : a string 4 characters wide.

Description

Adds 0's to the left of a number to a width of 4.

Example

console.log(nuPad4(7));

nuDebug()

0007


Also See : nuPad2, nuPad3,


nuPopup

nuPopup(string1, string2, string3)

Parameters

string1  : form id
string2  : record id
string3  : filter (only if there is no record id eg. a Browse Form)

Return Value


Description

Open a Form in a popup iFrame.

Example

nuPopup('nudebug', '', 'line 48');

nuDebug()



Also See :


nuPrintAction

nuPrintAction()

Parameters


Return Value


Description

If placed on an Object's click event, it will create a HTML form containing the current list in the Browse Form.

Example


nuDebug()



Also See : nuAddActionButton


nuRunPHP

nuRunPHP(string1)

Parameters

string1  : Procedure code

Return Value


Description

If placed on an Object's click event, it will run a Procedure in a new window.

Example


nuDebug()



Also See : nuAddActionButton


nuRunPHPHidden

nuRunPHPHidden(string1)

Parameters

string1  : Procedure code

Return Value


Description

If placed on an Object's click event, it will run a Procedure without seeing anything in the browser.

Example


nuDebug()



Also See : nuAddActionButton


nuRunReport

An Action Button that will run a Report.

nuSaveAction

nuSaveAction()

Parameters


Return Value


Description

If placed on an Object's click event, it will save the current record.

Example


nuDebug()



Also See : nuAddActionButton


nuSelectTab

Displays a certain Tab.

nuSetTitle

Changes the last breadcrumb to a certain value.

nuShow

nuShow(string1)

Parameters

string1  : Object id.

Return Value


Description

This will display all parts of a nuBuilder Forte Object.

Example

nuShow('cus_phone2');

nuDebug()



Also See : nuHide


nuSubformObject

object  : nuSubformObject(string1);

Parameters

string1  : Subform Object id

Return Value

object   : contains all properties of a [[Objects#Subform|Subform]]

Description

This returns a Javascript object that can be looped through.

Example

JSON.stringify(nuSubformObject('zzzzsys_tab_sf'))

nuDebug()


{
  "id": "zzzzsys_tab_sf",
  "foreign_key": "syt_zzzzsys_form_id",
  "primary_key": "zzzzsys_tab_id",
  "object_id": "570b3915874d635",
  "table": "zzzzsys_tab",
  "action": "save",
  "rows": [
    [
      "56777715b87666e",
      "Main",
      "10",
      0
    ],
    [
      "s14986964108605",
      "Test",
      "20",
      0
    ],
    [
      "-1",
      "",
      "",
      1
    ]
  ],
  "edited": [
    [
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0
    ],
    [
      0,
      0,
      0,
      0
    ]
  ],
  "deleted": [
    0,
    0,
    1
  ],
  "fields": [
    "ID",
    "syt_title",
    "syt_order",
    "nuDelete"
  ]
}


Also See :


nuTotal

Returns the value of a number Object.

nuTranslate

Swaps a nuBuilder phrase with a phrase in [[Translations=.