判断字符串的首字母 ---------startsWith

时间:2022-10-30 03:58:59

列:

{
                                            xtype : 'gridcolumn',
                                            dataIndex : 'nrMid3bit',
                                            text : 'Nr.mid',//零件号中间3位
                                            renderer: function(value, metaData, record) {//add renpei 20160527
                                                var partNum=record.get("partNum");
                                                if(null != partNum && partNum.length>5){
                                                    if(partNum.startsWith("N") || partNum.startsWith("n")){
                                                        return "N";
                                                    }else{
                                                        value=partNum.substring(3,6);
                                                        return value;
                                                    }
                                                }else{
                                                    return ;
                                                }
                                                
                                            },
                                            stateId:'QpnGridForQpn_033'
                                        }