Javascript: Difference between revisions

From nuBuilderForte
Jump to navigation Jump to search
Line 265: Line 265:
Displays a message.
Displays a message.
|example=<!-- EXAMPLE --><pre style="background-color:#f8dc3d">
|example=<!-- EXAMPLE --><pre style="background-color:#f8dc3d">
nuMessage(['Hello,','World']);
nuMessage(['Hello','World']);
</pre>|result=<!-- RESULT --><pre>
</pre>|result=<!-- RESULT --><pre>
</pre>|alsosee=<!-- SEE ALSO -->
</pre>|alsosee=<!-- SEE ALSO -->

Revision as of 14:14, 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

nuAddActionButton(string1, string2, string3);

Parameters

string 1  : Action Button id
string 2  : title
string 3  : function to run.

Return Value


Description

Add an Action Button.

Example

nuAddActionButton('nuRunPHPHidden', 'Build Fast Form', 'nuRunPHPHidden("RUNFF")');

nuDebug()



Also See :


nuBeforeSave

nuBeforeSave()

Parameters


Return Value


Description

Before a record is saved, nuBuilder checks for the existance of a function called nuBeforeSave().

If this exists it will use it's return value to decide whether to continue saving the record.

Example


function nuBeforeSave(){

    if($("[data-nu-field='ff_browse']:checked").length == 0){
        
        nuMessage(['At least 1 Browse needs to be checked..']);
        
        return false;

    }

    if($('#fastform_table').val() == ''){
        
        nuMessage(['Table Name cannot be left blank..']);
        
        return false;

    }
    
    return true;
    
}

nuDebug()



Also See :


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

nuEmailReportAction()

Parameters


Return Value


Description

If placed on an Object's click event, it will send areport as an email.

Example


nuDebug()



Also See : nuAddActionButton


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

nuGetBreadcrumb(number1, number2)

Parameters

number1  : breadcrumb number
number2  : tab number (optional)

Return Value


Description

Go to a prevoius Breadcrumb and a certain Tab.

Example

nuGetBreadcrumb(0,2);

nuDebug()



Also See :


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

nuID()

Parameters


Return Value


Description

Creates a unique string.

Example

nuID();

nuDebug()

"c14999473122991924"


Also See : nuID


nuMessage

nuMessage(array1)

Parameters

array1  : an array of strings

Return Value


Description

Displays a message.

Example

nuMessage(['Hello','World']);

nuDebug()



Also See :


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

nuRunReport(string1)

Parameters

string1  : a Report code

Return Value


Description

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

Example


nuDebug()



Also See : nuAddActionButton


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 : nuSubformObject


nuTotal

Returns the value of a number Object.

nuTranslate

Swaps a nuBuilder phrase with a phrase in Translations.