$(function () {
getdatepicker();
getdatetimepicker();
}); $(document).on('click','#addTable',addTr);
$(document).on('click','#deleteTable',deleteTr); function getdatepicker()
{
$("input[name='applydate']").datepicker({
clearBtn : true,
language : "ja",
autoclose : true
});
} function getdatetimepicker()
{
$("input[name='datetime']").datetimepicker({
clearBtn : true,
language : "ja",
autoclose : true
});
} function deleteTr(){ var i=$('#countTable').find('tr').size();
if(i!=2)
{
$("#countTable tr").eq(i-1).remove();
}
} function addTr(){
var tr_len=$('#countTable').find('tr').size();
var i=tr_len-1; var tr="<tr>";
tr=tr+"<td class='col-lg-2' id='applydatetb"+i+"'>";
tr=tr+" <div class='input-group date' id='datepicker"+i+"'>";
tr=tr+" <input type='text' class='form-control input-sm col-lg-1' id='clickDateFrom"+i+"' name='datepicker'>";
tr=tr+" <span class='input-group-addon'><i class='glyphicon glyphicon-th'></i></span>";
tr=tr+" </div>";
tr=tr+"</td>";
tr=tr+"<td class='col-lg-2' id='applykbtb"+i+"'>";
tr=tr+"<form role='form'>";
tr=tr+" <div class='form-group'>";
tr=tr+" <select class='form-control'>";
tr=tr+" <option> vacation </option>";
tr=tr+" <option> Working overtime on weekdays </option>";
tr=tr+" <option> Working overtime on weekends </option>";
tr=tr+" </select>";
tr=tr+" </div>";
tr=tr+" </form>";
tr=tr+"</td>";
tr=tr+"<td class='col-lg-2' id='startDateTimetb"+i+"'>";
tr=tr+" <div class='form-group'> ";
tr=tr+" <div class='input-group datetime' id='datetimepicker1"+i+"'>";
tr=tr+" <input type='text' class='form-control input-sm col-lg-1' id='applyDateTimeFrom"+i+"' name='datetime' >";
tr=tr+" <span class='input-group-addon'><i class='glyphicon glyphicon-th'></i></span>";
tr=tr+" </div> ";
tr=tr+" </div> ";
tr=tr+"</td>";
tr=tr+"<td class='col-lg-2' id='EndDateTimetb"+i+"'>";
tr=tr+" <div class='input-group datetime' id='datetimepicker2"+i+"'>";
tr=tr+" <input type='text' class='form-control input-sm col-lg-1' id='applyDateTimeTo"+i+"' name='datetime' >";
tr=tr+" <span class='input-group-addon'><i class='glyphicon glyphicon-th'></i></span>";
tr=tr+" </div>";
tr=tr+"</td>";
tr=tr+"<td class='col-lg-2' id='resontb"+i+"'>";
tr=tr+" <input type='text' class='form-control input-sm col-lg-1' id='reson"+i+"'></input>";
tr=tr+" </td>";
tr=tr+" <td class='col-lg-2' id='statustb"+i+"'>";
tr=tr+" <select class='form-control'>";
tr=tr+" <option> Confirmed </option>";
tr=tr+" <option> To be confirmed </option>";
tr=tr+" </select>";
tr=tr+ " </span>";
tr=tr+"</td>";
tr=tr+ "<td class='col-lg-2' id='addBtntb"+i+"'>";
//tr=tr+ "<span class='glyphicon glyphicon-plus-sign' aria-hidden='true' id='addTable"+i+"'></span>";
tr=tr+"</td>";
tr=tr+" <td class='col-lg-2' id='delBtntb"+i+"'>";
//tr=tr+" <span class='glyphicon glyphicon-minus-sign' aria-hidden='true' id='deleteTable"+i+"'></span>";
tr=tr+"</td>";
tr=tr+"</tr>";
$("#countTable").append(tr); $("#clickDateFrom"+i).datepicker({
clearBtn : true,
language : "ja",
autoclose : true
});
$("#applyDateTimeFrom"+i).datetimepicker({
clearBtn : true,
language : "ja",
autoclose : true
});
$("#applyDateTimeTo"+i).datetimepicker({
clearBtn : true,
language : "ja",
autoclose : true
}); }

jQuery To add table rows , Delete row , Call date control more related articles

  1. jquery Add table rows dynamically

    jquery Add table rows dynamically <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <h ...

  2. jQuery Datepicker Date control

    datepicker It can be for bootstrap Add an event selection control , It is suitable for any occasion that needs to be called , Support multiple event format output ( such as :dd, d, mm, m, yyyy, yy etc. ), It is an indispensable plug-in for making web pages . R ...

  3. JQuery datepicker Date control settings

    datepicker Control can switch languages through parameter setting , The following can be achieved , All date controls in the system are in Chinese by default , You can switch to English on a specific page or under specific conditions !~ HTML: <!DOCTYPE html> <h ...

  4. 【 Front end controls 】JQuery datepicker Date control settings

    datepicker Control can switch languages through parameter setting , The following can be achieved , All date controls in the system are in Chinese by default , You can switch to English on a specific page or under specific conditions !~ HTML: <!DOCTYPE html> <h ...

  5. jquery datepicker- Powerful date control

    stay web In development , There will always be situations where the user needs to enter a date . Generally, it provides a text Type of input For users to enter dates . However , This way, , The developer must verify the date entered by the user , Judge its legitimacy . besides , Let the user enter the date is also ...

  6. jQuery UI Date control --datepicker

    stay web In development , Date input often encounters . The solutions we will use are : 1. Write it yourself css and js, Control the date :---- It's a bit of a waste of energy and time : 2. use easyui Plug in date plug-in to achieve : 3. use juqery-ui ...

  7. 【SoDiaoEditor EMR editor 】 Periodic updates -- New check box 、 Date control 、 Form layout support, etc

    In the twinkling of an eye, the last time v2 It's been a month and a half since the official launch .github The period is irregular push More than 20 times , At the same time, thanks for being distributed in Guangzhou . fujian . Shanghai . Beijing's friends , That's what you're suggesting , Just let SoDiaoEditor Continuously improve . I ...

  8. FineUIPro v5.2.0 The published (jQuery upgrade , Custom icon , Date control )

    FineUIPro/MVC/Core/JS v5.2.0 Already in 2018-8-20 Release , The official website sample has been updated , If you find any problems in the test , Please reply to this post , Thank you for the . Online example : FineUI Pro:htt ...

  9. Jquery + css Examples of date control usage .zip

    /*==============================================================================** Filename:common.j ...

Random recommendation

  1. pragma

    In all preprocessing instructions ,#pragma Instructions are probably the most complex , Its function is to set the state of the compiler or instruct the compiler to complete some specific actions .#pragma Instructions for each The compiler gives a method , In keeping with C and C++ The language is completely compatible ...

  2. Unity Make it yourself keystore

    There's a lot of use on the Internet jdk Generate keystore Introduction to . It's complicated and not easy to understand . As a Unity Game developer , Make keystore It doesn't need to be that much trouble . Should be Unity It has its own production keystore The function of . Here's how to make ...

  3. openldap Host access control ( be based on hostname)

    http://mayiwei.com/2013/03/21/centos6-openldap/ http://www.zytrax.com/books/ldap/ch11/dynamic.html h ...

  4. Python What's the use of commas in ?

    Recent research python  Encountered a comma problem I haven't figured it out Today, I've finally figured it out 1. The use of commas in parameter passing : I don't say much about this situation   There's nothing to be puzzled about It is the comma between parameters when formal or actual parameters are passed for example def  a ...

  5. [AaronYang]C# People like to learn or not 8[ Events and .net4.5 In simple terms, the weak events in the world are more profound ]

    No great wishes , There is no great genius --Aaronyang The blog of (www.ayjs.net)-www.8mi.me 1. event - My way of speaking The teacher often tells me , Events are special delegates , Provides a release for delegates / Subscribe mechanism . ...

  6. C++ Default parameter value function

    1. Functions with default parameter values C++ The language allows you to give one or some formal parameters to a function when you define it ( Shape parameter ) Specify default , The method is to write... After the corresponding formal parameter “= The default value is ”, If you omit the value of the argument in the corresponding position , When the called function is executed, the default value of the parameter is used ...

  7. Fast batch import huge data to SQL SERVER database (ADO.NET)

    Original address :http://www.cnblogs.com/chenxizhang/archive/2008/11/11/1331060.html If you need to batch insert thousands of lines of data into the program , How would you write ...

  8. 【 Deep learning series 】 About PaddlePaddle Some of the avoidance “ pit ” skill

    Recently, in addition to work , Amateurs are taking part in Paddle Of AI match , In use Paddle There are some problems in the process of training , And found a solution , Share with you : PaddlePaddle Of Anaconda Compatibility problem Before I was serving ...

  9. vue Registration and easy use

      Component is to solve some column problems such as page layout . vue There are two components in , Global and local components . One   . Registering global components adopt Vue.component() After creating a global component , We can pass in one   ...

  10. ABP Permission blocking Second articles

    Due to the large number of visitors , I'll clean it up today ABP Authority authentication mechanism , To make it easier to read 1.Abp The permission interception of is mainly through the filter ,    public class AbpAuthorizationFilter : I ...