WHAT IS JQUERY DATA TABLE

WHAT IS JQUERY?

JQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT License. As of May 2019, jQuery is used by 73% of the 10 million most popular websites

jQuery is a lightweight, “write less, do more”, JavaScript library.

The purpose of jQuery is to make it much easier to use JavaScript on your website.

jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.

jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

The jQuery library contains the following features:

  • HTML/DOM manipulation
  • CSS manipulation
  • HTML event methods
  • Effects and animations
  • AJAX
  • Utilities

Tip: In addition, jQuery has plugins for almost any task out there.

WHAT IS A DATA TABLE?

The data table is perhaps the most basic building block of business intelligence. In its simplest form, it consists of a series of columns and rows that intersect in cells, plus a header row in which the names of the columns are stated, to make the content of the table understandable to the end user. This type of table is known in BI as a tabular report. A tabular report is used primarily–but not exclusively–to record information.

Data tables are the most basic component of BI, and still one of the most useful.

For example, if you are the sales manager of a company, you may have a tabular report in which five columns represent order dollar amount, order quantity, salesman and territory.

Another common type of data table in BI is the cross-tab report. With a cross-tab report, data starts to be grouped and organized in a more summarized way, making it more intelligible and therefore more useful for BI.

A cross-tab report is a data table in which there is not only a header row, but also a column (typically the left-most) that groups data in an intelligent way. Using our example of the sales manager’s report, a cross-tab version would group data by salesman (column on the left), and display the others as total dollar amount, total order quantity and territory.


Why use jQuery?

There are lots of other JavaScript libraries out there, but jQuery is probably the most popular, and also the most extendable.

Many of the biggest companies and sites on the Web use jQuery, such as:

  • Google
  • Microsoft
  • IBM
  • Netflix

Will jQuery work in all browsers?

The jQuery team knows all about cross-browser issues, and they have written this knowledge into the jQuery library. jQuery will run exactly the same in all major browsers.

What is jQuery used for?

What is jQueryjQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.

Features of jQuery are :

1. Effects and animations.
2. Ajax.
3. Extensibility.
4. DOM element selections functions.
5. Events.
6. CSS manipulation.
7. Utilities – such as browser version and the each function.
8. JavaScript Plugins.
9. DOM traversal and modification.

What is difference between JavaScript and jQuery?

The main difference among the three is that JavaScript is client-side, i.e., in the browser scripting language, whereas jQuery is a library (or framework) built with JavaScript. … At the same time, jQuery is a JavaScript framework that makes life easier for people who want to program for the browser

Advantages of jQuery.

The advantages of using jQuery are:

1. JavaScript enhancement without the overhead of learning new syntax

2. Ability to keep the code simple, clear, readable and reusable

3. Eradication of the requirement of writing repetitious and complex loops and DOM scripting library calls

4. Ease of use- it is more easy to use than the standard javascript and other libraries.

5. Large library – It has a lot of functions compared to javascript.

6. Strong opensource community – there are a lot of plugins available for the faster development of the applications.

7. Great documentation and tutorials – the jQuery website has plenty of tutorials that are required for the beginners.

8. Ajax support – They let you develop the templates easily.

What are the disadvantages of using jQuery?

  • The most critical disadvantage of jQuery is that it is a huge library to import. …
  • Another drawback is that jQuery’s abstraction hides the complex parts of JavaScript, making learning JavaScript much more difficult. …
  • jQuery DOM APIs are now obsolete.

JQUERY DATA TABLES?

A DataTable, which represents one table of in-memory relational data, can be created and used independently or can be used via a DataSet. We can create a DataTable object by using the DataTable constructor, or bypassing constructor arguments to the Add method of the Tables property of the DataSet, which is a DataTableCollection. We can also create DataTable objects within a DataSet by using the Fill or FillSchema methods of the DataAdapter object, or from a pre-defined or inferred XML schema using the ReadXml, ReadXmlSchema, or InferXmlSchema methods of the DataSet. Note that after we have added a DataTable as a member of the Tables collection of one DataSet, we cannot add it to the collection of tables of any other DataSet. When we first create a DataTable, it does not have a schema (a structure). To define the schema of the table, we must create and add DataColumn objects to the Columns collection of the table. We can also define a primary key column for the table, and create and add Constraint objects to the Constraints collection of the table. After we have defined the schema for a DataTable, we can add rows of data to the table by adding DataRow objects to the Rows collection of the table. We are not required to supply a value for the TableName property when we create a DataTable; we can specify the property at another time, or we can leave it empty. However, when we add a table without a TableName value to a DataSet, the table will be given an incremental default name of TableN, starting with “Table” for Table0. Note It is recommended that we avoid the naming convention of “Table” or “TableN” when we supply a TableName value, because the name we supply may conflict with an existing default table name in the DataSet. If the supplied name already exists, an exception will be thrown. The following example creates an instance of a DataTable object and assigns it the name “Customers”.

  1. DataTable currentTable = new DataTable(“Customers”);  

The following example creates an instance of a DataTable by adding it to the Tables collection of a DataSet.

  1. DataSet customerDS = new DataSet();  
  2. DataTable custTable = customerDS.Tables.Add(“CustTable”);  

In the following code example, we programmatically create a DataTable, set the primary key, and the AutoIncrement and ReadOnly properties of the DataColumn. This example code demonstrates how we can programmatically create DataTables.

  1. // Create the Table  
  2. DataTable OrdersTable = new DataTable(“Orders”);  
  3. // Build the Orders schema  
  4. ordersTable.Columns.Add(“ID”  
  5.         Type.GetType(“System.Int32”));  
  6. ordersTable.Columns.Add(“Name”  
  7.         Type.GetType(“System.String”));  
  8. ordersTable.Columns.Add(“Amount”  
  9.         Type.GetType(“System.Int32”));  
  10. // Set up the ID column as the PrimaryKey  
  11. DataColumn[] prmk = new DataColumn[1];  
  12. prmk[0] = ordersTable.Columns[“ID”];  
  13. ordersTable.PrimaryKey = prmk;  
  14. ordersTable.Columns[“ID”].AutoIncrement = true;  
  15. ordersTable.Columns[“ID”].AutoIncrementSeed = 1;  
  16. ordersTable.Columns[“ID”].ReadOnly = true

As we can see in this example, we create a new DataTable and define its schema by adding DataColumns. We use the DataTable constructor to create an empty DataTable named Orders. We saw Increment, IncrementSeed, and ReadOnly property that we set them programmatically. ADO.NET enables us to create DataTable objects and add them to an existing DataSet. We can set constraint information for a DataTable by using the PrimaryKey and Unique properties of DataColumn objects, which are added to the Columns collection of the DataTable. The following example constructs a DataSet, adds a new DataTable object to the DataSet, and then adds three DataColumn objects to the table. Finally, the code sets one column as the primary key column.

  1. DataSet customerDS = new DataSet(“CustomerOrders”);  
  2. DataTable ordersTable = customerDS.Tables.Add(“Orders”);  
  3. DataColumn pkCol = ordersTable.Columns.Add(“OrderID”, typeof(Int32));  
  4. ordersTable.Columns.Add(“OrderQuantity”, typeof(Int32));  
  5. ordersTable.Columns.Add(“CompanyName”, typeof(string));  
  6. ordersTable.PrimaryKey = new DataColumn[] { pkCol }; 

References by name to tables and relations in a DataSet are case-sensitive. Two or more tables or relations can exist in a DataSet that has the same name, but that differ in case. For example, we can have Table1 and table1. In this situation, a reference to one of the tables by name must match the case of the table name exactly, otherwise an exception is thrown. For example, if the DataSet SampleDS contains tables Table1 and table1, we would reference Table1 by name as SampleDS.Tables [“Table1”], and table1 as SampleDS.Tables [“table1”]. Attempting to reference either of the tables as SampleDS.Tables [“TABLE1”] would generate an exception. The case-sensitivity rule does not apply if only one table or relation exists with a particular name. That is, if no other table or relation object in the DataSet matches the name of that particular table or relation object, even by a difference in the case, we can reference the object by name using any case and no exception is thrown. For example, if the DataSet has only Table1, we can reference it using SampleDS.Tables [“TABLE1”]. The CaseSensitive property of the DataSet does not affect this behavior. The CaseSensitive property applies to the data in the DataSet and affects sorting, searching, filtering, enforcing constraints, and so on. References to the tables or relations in a DataSet are not affected by the CaseSensitive property. After we create a DataTable and define its structure using columns and constraints, we can add new rows of data to the table. To add a new row, declare a new variable as type DataRow. A new DataRow object is returned when we call the NewRow method. The DataTable then creates the DataRow object based on the structure of the table, as defined by the DataColumnCollection. The following example demonstrates how to create a new row by calling the NewRow method.

  1. DataRow workRow = currentTable.NewRow();  
  2. workRow[“CustLastName”] = “Smith”;  
  3. workRow[1] = “Smith”;  
  4. currentTable.Rows.Add(workRow);  
  5. currentTable.Rows.Add(new Object[] { 1, “Smith” }); 

Passing an array of values, typed as Object, to the Add method creates a new row inside the table and sets its column values to the values in the object array. Note that values in the array are matched sequentially to the columns, based on the order in which they appear in the table. The following example adds ten rows to the newly created Customers table.

  1. DataRow workRow;  
  2. for (int i = 0; i <= 9; i++) {  
  3.         workRow = currentTable.NewRow();  
  4.         workRow[0] = i;  
  5.         workRow[1] = “CustName” + i.ToString();  
  6.         currentTable.Rows.Add(workRow);  

We can access the contents of a DataTable using the Rows and Columns collections of the DataTable. We can also use the DataTable.Select method to return subsets of the data in a DataTable according to certain criteria including search criteria, sort order, and row state. Additionally, we can use the Find method of the DataRowCollection when searching for a particular row using a primary key value. The Select method of the DataTable object returns a set of DataRow objects that match the specified criteria. Select takes optional arguments of a filter expression, sort expression, and DataViewRowState. The filter expression identifies which rows to return based on DataColumn values, such as LastName = ‘Smith’. The sort expression follows standard SQL conventions for ordering columns, for example, LastName ASC, FirstName ASC. For rules about writing expressions, see the Expression property of the DataColumn class. Tip: If we will be performing a number of calls to the Select method of a DataTable, we can increase performance by first creating a DataView for the DataTable. Creating the DataView will index the rows of the table. The Select method will then use that index, significantly reducing the time to generate the query result. For information about creating a DataView for a DataTable, see Creating and Using DataViews. The Select method determines which version of the rows to view or manipulate based on a DataViewRowState. The following table describes the possible DataViewRowState enumeration values. 

Drop yoour comments


0Shares

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *