jeudi 22 février 2018

ag-grid React Header Component Select all Checkbox selection not working on mobile and tablet properly

I am facing a weird issue where I am implementing Header component Select all Checkbox selection.

It's working as expected on desktop but when I am testing the same functionality on tablet or mobile the checkbox selection is working randomly.

What I mean is when i am clicking inside checkbox its not getting checked but when I am clicking some where near to left border of checkbox it is getting selected.

Below is the code for the same:

column defs:

this.setState({
      terminalAllocationsColumnDefs: [
        {headerName:"",field:"status", width:150, cellRendererFramework: CheckBoxRenderer, headerComponentFramework : HeaderCheckBoxRenderer,HeaderChangeCallback:this.headerChangeCallback},
        {headerName: this.state.multiLangMsgs.TERMINAL_ID, field: "DId", width: 250},
        {headerName: this.state.multiLangMsgs.TERMINAL_TYPE, field: "DType", width: 250},
        {headerName: this.state.multiLangMsgs.MSISDN, field:"MsId", width:260},
        {headerName: this.state.multiLangMsgs.SIM_ID, field:"SimId", width:260},
        {headerName: this.state.multiLangMsgs.SATALITE_ID, field:"DKey", width:250}
      ]
    });

HeaderCheckBoxRenderer Component

onCheckBoxChange(){
        this.selectAll = false;
        if(this.state.checkStatus == "inactive"){
            this.setState({
                checkStatus :"active"
            });
            this.selectAll = true;
        }else {
            this.setState({
                checkStatus: "inactive"
            });
        }
        // }console.clear();
        // console.log(this);
            try{
                if(this.props.column.colDef.HeaderChangeCallback){
                    this.props.column.colDef.HeaderChangeCallback(this.selectAll);
                }
            }catch(e){}
    }
    render() {
        return (
            <div class="ag-header-cell" style=padding>
                <div class="ag-header-cell-resize"/>
                <div class="ag-header-select-all"/>
                <div class="ag-header-component"/>
                <input id="checkboxMember" type="checkbox" onClick={this.onCheckBoxChange.bind(this)} className="check" checked={this.state.checkStatus == "active" ? true : false}/>
            </div>
        );
    }




Aucun commentaire:

Enregistrer un commentaire