This article mainly introduces the reference value of BootstrapTable and KnockoutJS in combination to add, delete, modify, and Query [2, if you are interested in learning it together, I will introduce the functions of combining BootstrapTable with KnockoutJS to achieve addition, deletion, modification, and query. [1] I will introduce knockout. some basic usage of js. Next, we will continue to introduce you through this article. If you plan to use ko for the project, check it out!
Bootstrap is a front-end framework that frees Web developers and shows a very high level of UI. Theoretically, you do not need to write a line of css. You only need to add the appropriate attributes to the tag.
KnockoutJS is a JavaScript-implemented MVVM framework. Great. For example, after adding or removing list data items, you do not need to refresh the entire control segment or write JS add or delete nodes by yourself. You only need to pre-define the template and attributes that comply with its syntax definition. Simply put, we only need to pay attention to data access.
I. effect Preview
In fact, there is no effect, that is, simple addition, deletion, modification, and query. The focus is on the Code. Using ko can greatly save interface DOM Data Binding operations. The following is the js Code for the entire addition, deletion, modification, and query logic:
Page effect:
Ii. Sample Code
Okay, let's go to the point! The blog focuses on two parts: The first part is the table initialization part, and the second part is the addition, deletion, and modification part of the button operation.
1. Table Initialization
1.1 preparations
First look at the js and css files to be referenced