I'm having a problem with button groups for bootstrap.
Right now I have jquery ui js called before bootstrap js and the button gorup works fine. However, if i keep this structure, jquery ui dialog buttons do not work, specifically the close button does not show due to conflicting js code.
If i switch the order then the jquery ui dialog close button shows but the button groups for bootstrap are all messed up, because of the conflict between the two js libraries.
I have tried using bootstraps solution:
var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the Bootstrap functionality
Then when calling $(".btn").bootstrapBtn() and testing the button group every time i click a new button in the group i get the error:
cannot call methods on button prior to initialization; attempted to call method 'toggle'
I have done a ton of research and still can't come up with a solution.
Here is my code:
<div id="chartSelector" class="row" style="margin-left:auto;margin-right:auto;width:170px;display:none;">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default active">
<input class="barChart" data-target="barChart" type="radio" name="options" id="bar" checked> Bar
</label>
<label class="btn btn-default">
<input class="pieChart" data-target="pie-section" type="radio" name="options" id="pie"> Pie
</label>
<label class="btn btn-default">
<input class="columnChart" data-target="columnChart" type="radio" name="options" id="column"> Column
</label>
</div>
<div class="bar-section k-content">
<div class="chart" id="barChart"></div>
</div>
<div class="container-fluid pie-section k-content">
<div class="row chart" id="pie-section"></div>
</div>
<div class="column-section k-content">
<div class="chart" id="columnChart"></div>
</div>
And my JS to handle the buttons:
$('.btn').button();
$('input[type=radio]').on('change', function () {
var target = "#" + $(this).data("target");
$(".chart").not(target).hide();
$(target).show();
kendo.resize($(".k-content"));
});
PS: Using Jquery UI version 1.11.1 and Jquery version 1.11.1
kendo-ui
expertise to be answered. Therefore,kendo-ui
tag is not necessary. You apply tags to attract specialists in that particular technology to answer the question. In layman's terms, you should apply thetram
tag when you have a broken tram you need to fix, not when you got into a tram to get to the job. – Kimberelykimberleekendo.resize(
in there but this is pretty old and kendo has moved on from well...anyway opinions differ - and none of the answers has been accepted. – Ewankendo-ui
expertise to answer it. Also, considering it's a UI library, there might be specialists inkendo-ui
which might lack the required CSS expertise to answer this question (similar to how a Bootstrap expert knows what classes and/or markup to apply without necessarily knowing much about the actual CSS rules involved). Applying a tag is a statement: "A comprehensive answer is likely to require expertise in X technology". I don't think that's debatable. – Kimberelykimberleekendo-ui
tag to Q/A's specific to it which would not apply outside of KendoUI scope. If the answer works anywhere, the tag is irrelevant. And I don't have something againstkendo-ui
. I apply the same logic to any other tags. – Kimberelykimberlee