Dorado7 basic data operation method

Source: Internet
Author: User

 

I. Methods of adding data
The code in onsubcontrolaction (self. Arg) in datapilot is:

VaR code = Arg. Code;

Switch (CODE ){
Case "+ ":
// Obtain the DataSet object of the master table
VaR datasetdept = this. Get ("# ID of the master table datasetde ");

// Obtain the dataset of the master table
VaR currentdept = datasetdept. getdata (#);

// Obtain the dataset corresponding to the reference based on the dataset of the master table.
VaR currendtemployees = currentdept. Get ("name value of reference in the main table ");

// Insert an object to the dataset Based on the obtained dataset. Note that the deptid here is not a field in the database, but an attribute of the object class.
Currentemployees. insert ({deptid: currentdept. Get ("ID ")});

// Prevent the system from automatically adding a row
Arg. processdefault = false;
Break;
}

When such code is required in a single table: (this method is generally used when the dialog box is used for modification)
VaR code = Arg. Code;

Switch (CODE ){
Case "+ ":
// Obtain the table Dataset
VaR dataset = this. Get ("# dataset ID ");

// Enter an empty record. All data is added in the dialog box.
Dataset. insert ({});

// The control system automatically adds
Arg. processdefault = false;

// Display the dialog box and submit data on the button in the dialog box
VaR dialog = this. Get ("# dialog ID ");
Dialog. Show ();
Brek;
}

The method on the cancel button is generally written as follows:
VaR dataset = this. Get ("# ID ");
// You can use the cancle function to cancel data modification since the last submission.
Dataset. getdata (). cancle ();
This. Get ("# dialog box ID"). Hide ();


Write this on the OK button, better:
VaR updateaction = this. Get ("# updateaction ");
Updateaction.exe cute (function (){
This. Get ("# dialogid"). Hide ();
});

$ {Dorado. getdataprovider ("baseclasspr # getcodes"). getresult ("clienttype ")}
$ {Dorado. getdataprovider ("baseclasspr # getcodes"). getresult ("sedsettype ")}

Ii. display of data that requires conditional Query when displaying data, including pagination
Click confirm to query the data.

// Obtain the autoform object
VaR autoform = this. Get ("# autoformid ");

// Obtain the DataSet object
VaR dataset = this. Get ("# datasetid ");

// Obtain the data filled in autoform
VaR DATA = autoform. Get ("entity ");

// Pass data as parameters
Dataset. Set ("parameter", data );

// Refresh the dataset
Dataset. flushasync ();


$ {Dorado. getdataprovider ("deptdao # getalldept"). getresult ()}

 

Ondatarowclick () on the node on the tree ()

VaR nodeurl = self. Get ("currentnode"). Get ("data ");
VaR mainiframe = This. ID ("mainiframe ");
Mainiframe. Set ("path", nodeurl );

// Onrwndercell () in the DataGrid ()
Arg. Dom. innerhtml = "<a href = '../issure. D? Id = "+ Arg. Data. Get ('id') +" '> "+ Arg. Data. Get ('id') +" </a> ";

 

//////////////////////////////////////// ////////// You can specify the value when you click Delete.
VaR updataaction = This. ID ("updateactionuserbsdn ");

Switch (CODE ){
Case "+ ":
 
Arg. processdefault = false;
Currentreference. insert ({corp_id: currentdatapath. Get ("ID ")});
Break;
 
Case "-":
 
Arg. processdefault = false;
Dorado. MessageBox. Confirm ("delete data? ", Function (){
Currentreference. Remove ();
Updataaction.exe cute ();
});
Break;
}

//// // Use the request in Dorado to obtain the information in the code.
VaR rerrormsg = "$ {request. getattribute ('rerrormsg ')}";

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.