4

我正在使用 FuelUX 向导插件 http://getfuelux.com/javascript.html#wizard创建一个向导控制页面

我试图仅在向导的 STEP1 上禁用 NEXT 按钮。

请检查此图像以更好地理解:http: //i.imgur.com/xlhwu2j.png

我很想在这方面得到一些帮助。让我知道是否需要我这边的任何东西。

4

3 回答 3

2

好的。经过大量研究,我为您提供了这个解决方案。您需要修改插件fuelux.js。获取未缩小版本的fuelux.js 并找到下面的代码行

var canMovePrev = ( this.currentStep > 1 ); //remember, steps index is 1 based...
var isFirstStep = ( this.currentStep === 1 );
var isLastStep = ( this.currentStep === this.numSteps );

// disable buttons based on current step
if ( !this.options.disablePreviousStep ) {
         this.$prevBtn.attr( 'disabled', ( isFirstStep === true || canMovePrev === false ) );
}

// change button text of last step, if specified
var last = this.$nextBtn.attr( 'data-last' );
if(isFirstStep) //Add this line
{
    this.$nextBtn.attr( 'disabled', ( isFirstStep === true || canMoveNext === false ) );
}

您可以在上面的行中找到它setState: function() {的行号3652

如果您遇到任何问题,请告诉我

编辑:并与您交替使用下一个按钮,您可以将其编写如下

$(document).ready(function(){
   $('.btnext').on('click',function(){
         $('.wizard').wizard('next');
         $nextBtn = $('.wizard').find( 'button.btn-next' );
         $nextBtn.removeAttr('disabled');
    });
});

将您的备用按钮添加到您想要的任何位置,然后btnext向其中添加一个类。

于 2015-03-24T10:08:49.287 回答
0

我真的尝试了人们给出的所有建议。我不知道为什么似乎没有一个对我有用。可能是因为我没有提供足够的信息。在我尝试的几种方法中。我发现这个是最简单的。

protected void NextButton_Click(object sender, WizardNavigationEventArgs e)
{
       //Suppose You have a control on your webpage. Just check if it has
       //the information you require. In my case lblpasskeytextbox
       //and if the condtion is not fulfilled I am not letting user to move
       //next page
        if (lblPasskeyInformation.Text[0] == 'I')
        {
            e.Cancel = true;
            return;
        }
}
于 2015-06-05T15:24:42.360 回答
0

在阅读了燃料 ux 文档后,这里似乎有一个 hack,它允许您在不修改任何源fuelux.js 代码的情况下禁用特定步骤。

    $wizard.on('actionclicked.fu.wizard', function (evt) {

    //Check the current step 
    var currentStep = $wizard.wizard('selectedItem').step;

    //If current step needs to be disabled, disable it and then return.
    if (currentStep === 1)
    {
        evt.preventDefault();
        return; 
    }



});

请注意,$wizard这只是我在燃料 ux文档$('#myWizard')中描述的说法。

于 2017-01-04T19:50:10.193 回答