Dhtmlxgrid v3.0 Study Notes

Source: Internet
Author: User

Dhtmlxgrid v3.0 Study notesCategory: dhtmlx JavaScript2012-01-31 15:41 1744 people read Comments (0) favorite reports STYLESHEETDATECALENDARCSS Calendar XML

Directory (?) [+]

Because there is a need for page display and printing, so for Dhtmlxgrid to do a simple study, referring to the example given by Dhtmlxgrid to explore

1, must introduce the JS package [HTML]View Plaincopy
  1. <link rel="STYLESHEET" type="text/css" href= "css/dhtmlxgrid.css">
  2. <link rel="stylesheet" type= "text/css" href= "css/dhtmlxgrid_dhx_skyblue.css ">
  3. <link rel="STYLESHEET" type="text/css" href= "css/dhtmlxcalendar.css">
  4. <script src="Js/dhtmlxcommon.js"></script><!-- DHTMLX Foundation js-->
  5. <script src="Js/dhtmlxgrid.js"></script><!--dhtmlxgrid base js-->
  6. <script src="Js/dhtmlxgridcell.js"></script><!-- Dhtmlxgrid Foundation js-->
  7. <script src="Js/dhtmlxcalendar.js"></script><!--support for date controls--
  8. <script src="Js/dhtmlxgrid_excell_dhxcalendar.js"></script> <!--support for date controls--
  9. <link rel="STYLESHEET" type="text/css" href="Css/dhtmlxcalendar_dhx_skyblue.css" >
2. Initialization code 2.1. Put a table container on the page first [HTML]View Plaincopy
    1. <div id= "gridbox" style="width:503px;height:120px;background-color:white;" ></div>
2.2. Page initialization [HTML]View Plaincopy
  1. <script>
  2. Mygrid = new Dhtmlxgridobject (' Gridbox ');//similar to a declaration
  3. Mygrid.setimagepath ("/imgs/"); Set Picture storage path
  4. Mygrid.setheader ("Name,date of Birth, first book Published");//Set table header name
  5. Mygrid.setinitwidths ("*,100,100"); Set table Initial column width
  6. Mygrid.setcolalign ("Left,center,center");//Set table alignment
  7. Mygrid.setcoltypes ("Ed,dhxcalendar,dhxcalendara");//Set the data type of each column
  8. Mygrid.setcolsorting ("Str,date,date"); Set the sort type for each column
  9. Mygrid.setskin ("Dhx_skyblue"); Set style
  10. Mygrid.init (); To initialize
  11. Mygrid.loadxml ("Data.xml"); Loading external Data
  12. </Script>
Report: SetcoltypesSupported column types

Ro

Read-only

Ed

Small text, double-click Edit in place

Txt

Large amount of text, double-click to pop up a text area for editing

Ch

check box, the value is 1, the unselected value is 0

Ra

Single box, only one of the columns is selected, with a value of 1 selected

Coro

Drop-down list, users can only select values that are already in the list

Co

Compound drop-down list, which can be selected by the user or self-input

Img

Picture, read-only, value for the URL of the picture

Link

Link, the format of the value is "link text ^ link address ", non-normal hyperlink notation. (need to load Dhtmlxgrid_excell_link.js file to support it)

Calendar

Date, double-click the pop-up calendar. date format is mm/dd/yyyy. You need to load the Dhtmlxgrid_excell_calendar.js file to support it, and before you load the file, define the global variables _css_prefix,_js_prefix as follows:<script >_css_prefix= "styles/"; _js_prefix= "js/"; </script>

setcolsortingSupported Sort types:

Int

Integral type

Str

String

Date

Date

Dhtmlxgrid v3.0 Study Notes

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.