我们如何显示标签栏上的文本

我们如何显示标签栏上的文本

本文介绍了我们如何显示标签栏上的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Helo Freinds

我已经创建了选项卡栏,当我们单击选项卡栏时,必须显示视图页面.在该视图页面中,它包含有关该选项卡栏的信息

我的查看页面代码

Helo Freinds

I had created tab bar When we click tab bar the view page has to displayed.In that view page it contains information about that tab bar

my view page code

var tabbars = [];

    tabbars[0] = initTabbar("b_tabbar", "right", "left");
    tabbars[1] = initTabbar("a_tabbar", "top", "left");
    tabbars[0].setSkin('dhx_skyblue');
    tabbars[1].setSkin('dhx_skyblue');

    tabbars[0].setImagePath("../../codebase/imgs/");
    tabbars[1].setImagePath("../../codebase/imgs/");
    var formData;
    var myForm = new dhtmlXForm("form_container", formData);
    dhxWins = new dhtmlXWindows();
    dhxWins.setImagePath("dhtmlxWindows/codebase/imgs/");
    var popupWindow = dhxWins.createWindow("b_tabbar", 0, 0, 250, 250);
    popupWindow.hide();
    formData = [{
        type: "input",
        label: "Enter Tab",
        name: "Name",
        value: ""
    },
    {
        type: "button",
        name: "Save",
        value: "Save",
        command: "Save"
    }, {
        type: "button",
        name: "Cancel",
        value: "Cancel"

    }
    ];
    var myForm = popupWindow.attachForm(formData);

    var url = '/Home/Database'
    $.ajax({ type: "GET",
        url: url,

        dataType: "json",
        error: function (xhr, status, error) {
            alert(error);
        },
        success: function (json) {
            var c = 1;
            var d = 0;
            for (i = 0; i <= 3; i++) {
                c++;

                d++;
                tabbars[1].addTab("a" + d, json[i].Tabname, "60px");
                tabbars[1].setContentHTML("a1", "<b>HTML</b>");
                if (c == 5) {

                    tabbars[1].addTab("a" + c, "newtab", "60px");

                    var lastTab = "a" + c;

                    tabbars[1].attachEvent("onSelect", function (id, prevId) {

                        if (id == lastTab) {
                            popupWindow.show();
                            popupWindow.center();
                            popupWindow.button("close").disable();
                            myForm.setItemFocus("Name");

                        }
                        return true;
                    });

                    var c = 6;
                    myForm.attachEvent("onButtonClick", function (name, command) {
                        if (name == "Save") {

                            var value = myForm.getItemValue("Name");
                            //            lastTab = "a" + c;
                            var index = tabbars[1]._rows[0].tabCount - 1;

                            tabbars[1].addTab("a" + c, value, "60px", index);
                            tabbars[1].setTabActive("a" + c);

                            c++;

                            popupWindow.hide();
                            tabbars[1].setContentHTML("a" + c, "a <br/> b");
                        }
                    });
                    myForm.attachEvent("onButtonClick", function (name, command) {


                        if (name == "Cancel") {

                            popupWindow.hide();
                            tabbars[1].setTabActive("a4");


                        }
                    });
                }

                myForm.attachEvent("onButtonClick", function (name, command) {

                    if (name == "Save" && command == "Save") {

                        $.ajax({

                            url: "/Home/Save",

                            data: JSON.stringify({

                                name: myForm.getItemValue("Name")
                            }),
                            cache: false,
                            dataType: "json",
                            success: function (str) {
                                alert(str.st);

                            },
                            type: 'POST',
                            contentType: 'application/json; charset=utf-8'
                        });
                    }
                });
            }
        }
    });


    $.getJSON('/Home/AddTab', "", function (data) {
        tabbars[0].setHrefMode("ajax-html");
        tabbars[0].addTab("b1", "<div class='rotated" + (isIE8 ? " ie_filter" : "") + "'>" + data.Tab1 + "</div>", "60px");
        tabbars[0].addTab("b2", "<div class='rotated" + (isIE8 ? " ie_filter" : "") + "'>" + data.Tab2 + "</div>", "60px");
        tabbars[0].addTab("b3", "<div class='rotated" + (isIE8 ? " ie_filter" : "") + "'>" + data.Tab3 + "</div>", "60px");
        tabbars[0].setContentHref("b1", "../../Home/About");
    });




在此代码中,将视图页面引用添加到选项卡栏的位置.




In this code where to add view page reference to the tab bar

推荐答案






在此代码中,将视图页面引用添加到选项卡栏的位置




In this code where to add view page reference to the tab bar


这篇关于我们如何显示标签栏上的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 02:49