Solution:
(1) Ext.getCmp(id).setText('XXXX') can dynamically set the text value displayed by label, but there are individual numbers in the text that need to change the color display, need to add style, this method will display the styled label (html) in a text manner, but not be parsed by browsers.
(2) Ext.getCmp(id).getEl().update('XXXXX'). Writing the text and style code to be displayed into update() method is to realize the dynamic setting of html display.

 

Dynamic call code:

        var b = window.unitCount == undefined ? 0 : window.unitCount;
        Ext.Ajax.request({
            url: "url",
            asynchronous: false,
            success: function (response) {
                //debugger
                var data = response.responseText;
                // data = Ext.decode(data);
                var result = eval("(" + data + ")");
                if (result.num0 != "") {
                    // var count = result.num0 + result.num1 + result.num3;
                    // debugger
                   // a.setText("Have chosen" + b + "Units, total" + result.num + "Planned positions, of which no approval has been initiated" + result.num0 + "Yes, approval has been initiated." + result.num1 + "Yes, the approval is over." + result.num3 + "individual");
                    // a.html("33 Have chosen" + b + "Units, total" + result.num + "Planned positions, of which no approval has been initiated" + result.num0 + "Yes, approval has been initiated." + result.num1 + "Yes, the approval is over." + result.num3 + "individual");
                    Ext.getCmp("labelInfo").getEl().update("Have chosen<span style='color:red'>" + b + "</span>Units, total<span style='color:red'>" + result.num + "</span>Planned positions")
                        //,No approval was initiated.<span style='color:red'>" + result.num0 + "</span>Yes, approval has been initiated.<span style='color:red'>" + result.num1 + "</span>Yes, the approval is over.<span style='color:red'>" + result.num3 + "</span>individual");
                }
                    // debugger
                else {
                    Ext.Msg.alert('Tips', 'operation failed');
                    // me.Reload();
                }
            },
            failure: function () {
                Ext.MessageBox.alert("error", "network error");
            },
            params: {
                departmentid: params.departmentid, Rids: params.ApprovalUnitID
            }
        });

Ext. getCmp ("label Info"). getEl (). update ("selected < span style ='color: red'> + B +" </span > units, total < span style ='color: red'> + result. num + </span > planned positions")

Effect: