Search

MachPanel Knowledgebase

INFO:Hide unwanted sections using Javascript from MachPanel

Mudesira Munir
MachPanel

Summary

This article provides the summary on Hide/Remove any unwanted information/section from Provider/Reseller/Customer dashboard..

Applies To
This article applies to MachPanel build v5 5.23 and above.
Prerequisites:
At Control Server location “/MachPanel Control Server/JS”, following JavaScript files are needed for such customization:
  1. custom-fixes-rcc.js          (For Provider/Reseller)
  2. custom-fixes.js                 (For Customer)

If corresponding file is not present at specified location, please create new file with extension “.js” (JavaScript file)


Steps to achieve it:

Get the identity of the section that is needed to be hidden:
(Right-Click the control and select “Inspect Element” to see the identity as shown below)

  • Write code snippet in above corresponding JS file to hide/remove the specific section as described below:
Code Snippet

$(document).ready(function () {
                $('#ctl00_CPH_Content_Div_Billing').remove();    
});

 

 

 

 (Replace Highlighted text with the identity of any section you want to hide)

  • Save & Close the file and it is Done.
  • Perform IISRESET
  • Refresh the browser (best to close browser windows and reopen) to see the effect.

 

Sample Scenario 1:
Hide Billing Information in Customer Dashboard.



Steps:
  • Create/Open “custom-fixes.js” file at location “/Web/JS/”
  • Identity for the control is “ctl00_CPH_Content_Div_Billing”
  • Sample Code to hide the section:

$(document).ready(function () {
                $('#ctl00_CPH_Content_Div_Billing').remove();    
});

 

 

 

 

  • Save & Close the file
  • Customer dashboard is refreshed and the billing section is removed:


Note:  Similarly, client can add things in html using JS. To make changes to store you need to:

Change contents of:

/JS/custom-fixes-store.js

 
Sample Scenario 2:

Is Taxable checkbox should be "unchecked" by default when creating customer.

Steps:
  • Create/Open “Custom-Fixes-RCC.js” file at location “C:/ProgramFiles/MachSol/MachPanel Control Server/JS/”
  • Identity for the control is “ctl00_CPH_Content_CB_Taxable"
  • Sample Code is:

$(document).ready(function () {
                $("#ctl00_CPH_Content_CB_Taxable").removeAttr("checked");
});

 

 

 

 

  • Save & Close the file
  • Perform "IISRESET" on control panel server.
  • Close and reopen the browser and control panel web interface.
  • Load the Create customer interface and you will notice that "Checkbox" for "Is Taxable" will be unchecked by default.

Details
Type: INFO
Level: Intermediate
Last Modified: 3 Months Ago
Last Modified By: zohaib.shaikh
Rated 4 stars based on 2 votes.
Article has been viewed 17K times.
Options
Also In This Category
Tags