当我点击kendo标签时,kendo TabStrip无法正常工作,它会附加网址

时间:2015-05-20 04:48:16

标签: javascript jquery kendo-ui-mvc kendo-tabstrip

        // this is my kendo strip code...... 

         @(Html.Kendo().TabStrip()
                .Name("TabStripPatientHome")
                .Items(tabStrip =>
                {
                    tabStrip.Add()
                        .Text("Patient Home")
                        .Content(@<text>                          
                            <table >
                                <tr>
                                    <td>
                                        Last Order/Consult
                                        <br />
                                        @LastOrderConsultData()
                                    </td>
                                </tr>
                            </table>

                        </text>);

                    tabStrip.Add()
                        .Text("History")
                        .Content(@<text>
                            <p style="font-size: large; color: Navy;">
                                Order/Consult History
                            </p>
                            @RenderOrderHistory()
                            <br />

                            <p style="font-size: large; color: Navy;">
                                Consult Pre-Purchase History
                            </p>
                            @RenderTeleconsultHistory()
                        </text>);

                    }
                })

//定义剑道事件

.SelectedIndex(0)
    .Events(events => events
 // triggering select event in Kendo UI TabStrip.                                                                    .Select("onSelectTab")
                                                                     .ContentLoad("onLoadTab"))

        )

//使用ajax调用触发select和content load事件.....

function onSelectTab(eventItem) {
        debugger;

        setTimeout("saveTabIndexSession();", 1000);
    }

    function onLoadTab(eventItem) {
        debugger;
        setSelectedTabIndex();
    }

    function setSelectedTabIndex() {
        debugger;
        var tabStrip = $("#TabStripPatientHome").data("tTabStrip");
        var tabIndex = getPatientTabIndex();
        //alert(tabIndex);
        tabStrip.select($(".t-item", tabStrip.element)[tabIndex]);
    }

    function getPatientTabIndex() {
        debugger;
        var returnVal = 0;
        $.ajax({
            url: '@Url.Action("GetTabIndexFromSession", "Operations")',
            type: 'POST',

            success: function (data) {
                returnVal = parseInt(data);
            },
            async: false,
            error: function (xhr) {
                alert("Something went wrong while checking Order Details, please try again");
            }
        });



        return returnVal;
    }

    function saveTabIndexSession() {
        debugger;
        var tabStrip = $("#TabStripPatientHome").data("tTabStrip");
        var tabIndex = tabStrip.getSelectedTabIndex();
        $.ajax({
            url: '@Url.Action("SaveTabIndexSession", "Operations")',
            type: 'POST',
            data: { selectedTabIndex: tabIndex },
            success: function (data) {

            },
            async: false,
            error: function (xhr) {
                alert("Something went wrong while checking Order Details, please try again");
            }
        });
        //return _IsRXProductOrder;
    }

// when i am clicking on another kendotab it append the url like #TabStripPatientHome-2

//  http://operations.mdalignelocal.com/Operations/PatientHome?Patientid=837545#TabStripPatientHome-2

0 个答案:

没有答案