Uncheck table row in bootstrap table on specific condition

后端 未结 2 433
礼貌的吻别
礼貌的吻别 2020-12-11 13:57

My previous question was this and I want to uncheck checked row if user selects a row that has \'Stock Available=null or 0\'. Now my jquery code is:

$(docume         


        
2条回答
  •  不思量自难忘°
    2020-12-11 14:29

    About to uncheck the Row if is it has 'Stock Available=null or 0, I assume that you are using the bootstrap-table by wenzhixin and that your data has a unique id like you mentioned row.id in your question

    My Approach goes like this: 1. Define a unique ID of your table when you are loading the Data 2. oncheck : use row to check if the Stock_Available is null or 0 3. if Yes use the method

    $("#table").bootstrapTable("uncheckBy", { field: "Stock_Available", values: [row.id] })
    

    Here is the solution http://jsfiddle.net/pacitwizere/xjvp8xq0/5/

提交回复
热议问题