Documentation
SolutionDeveloperComplianceProjects
  • Getting Started
  • Technology
    • Application Framework
    • Object-Relational Mapping
    • Security Framework
    • Architecture Pattern
    • API Management
  • Environment
    • Development Tool
    • Database Server
    • Web Server
  • PRESENTATION
    • Design Material
    • HTML Helpers
    • Icon Images
    • Custom CSS
    • JQuery Plugin
      • DataTables
      • Tabs
      • Date Picker
      • Calendar
      • Chart
      • Treeview
    • Client Script
      • Open Modal
      • Close Modal
      • Handle return data
      • Load Content
      • Change Hash
      • Change Title
      • Get actual Hash
      • Get Content
      • Update Content
      • Delete Content
      • Get Partial Content
      • Get Partial Content Async
      • Update Partial Content
      • Update Partial Content Async
      • Delete Partial Content
      • Get Action
      • Update Action
      • Delete Action
      • Cascading Dropdown
      • Display Document
    • MVC View
  • BACKEND
    • Base Controller
    • Controller
    • Base Model
    • View Model
    • Class Utility
      • Constant Values
      • Global Properties
      • Option Helper
      • Setting Helper
    • Data Repository
      • Read Columns
      • Read All Columns
      • Read First Record
      • Read by Primary Key
      • Find Record
      • Insert Record
      • Update Record
      • Delete Entity
      • Delete by Criteria
      • Delete by Primary Key
      • Counting Record
      • Check Exist
      • Generate Row-Id
    • Unit Of Work
    • Data Entity
  • Application Features
    • Account Management
    • Navigation Editor
    • Access Control
  • Examples
    • Simple Page
    • Master Detail
    • Editor Template
Powered by GitBook
On this page
  • Syntax
  • Arguments
  • Description
  • Example
  • Example 1: Deleting content without changing URL in address bar
  • Example 2: Deleting content with changing URL in address bar
  1. PRESENTATION
  2. Client Script

Delete Content

Syntax

$.deleteContent = function (url, chg, newUrl)

Arguments

url

String

URI of the action whose content should be deleted.

chg

Boolean

If true, additionally change the URI in the address bar.

false

newUrl

String

If parameter “chg” is set to true, this parameter must not be empty. This parameter must be different from the parameter “url”. The URI will be changed into the value of this parameter.

Description

Loads data from the Server into the Page Container by sending an HTTPDELETE request to the action of the URI specified in “url”. It should be used when the action of the URI deletes data from the database.

If parameter “chg” is set to true, the current URI gets changed into the URI specified in “newURL”. If argument “chg” is set to true and argument “newUrl” is empty, then the URI gets changed into the URI specified in “url”.

If the URI that is specified in “newURL” does not exist or contains a spelling error, the function will still treat it as valid URI and load the page but an error message from the browser will likely follow.

Example

Example 1: Deleting content without changing URL in address bar

The following program illustrates the function call with only one parameter:

$.deleteContent("main/delete/" + 1234);

It will send a request to “main/delete” along with the parameter of the action set to 1234 (specifying the data to be deleted) and load the response into the Page Container replacing the content that is currently displayed. The URI in the address bar stays the same.

Example 2: Deleting content with changing URL in address bar

The following program illustrates the function call with second parameter set to true:

$.deleteContent("main/delete/" + 1234, true, "main/page");

It will send a request to “main/delete” along with the parameter of the action set to 1234 (specifying the data to be deleted) and load the response to Page Container replacing the content that is currently displayed. The URI that is currently displayed in the address bar gets replaced by “main/page”.

PreviousUpdate ContentNextGet Partial Content

Last updated 2 years ago