DataTable taking over all links

DataTable taking over all links

MeMyselfAndIMeMyselfAndI Posts: 3Questions: 1Answers: 0

Hello,

First of all I want to say an ENORMOUS THANK YOU for putting out this beautiful piece of work for all of us out there.

I've been using this plugin with a high rate of acceptance and I'm planning to include it as part of the regular T4 Visual Studio MVC templates to generate every single table as a DataTable in our systems.

I've been creating mockup sites and up until now I've noticed that some links weren't working but I thought it was a minor JS issue and now that I'm focused more on it I realized that the issue is that as soon as I include datatable.min.js on my pages it is taking over of every link on that page (even the ones that are not inside a datatable) I'm trying to understand what is going on but I'm not that good at finding it. I've used Visual Event and I confirmed that the links are attached to the line 25 on DataTable.min.js (if that helps in any way).

Is there a way to indicate DataTable that it should NOT be taking over some link?

Again, thank you so much

This question has an accepted answers - jump to answer

Answers

  • MeMyselfAndIMeMyselfAndI Posts: 3Questions: 1Answers: 0
    <div class="form-group col-lg-12">
        <div class="panel-group col-lg-12" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion" href="#coll1">
                            <i class="fa fa-users" aria-hidden="true"></i>&nbsp;Collapsible 1
                        </a>
                    </h4>
                </div>
                <div id="coll1" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-hover table-striped" style="width:100%;">
                                <thead>
                                    <tr>
                                        <th>Col1</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @foreach (var item in Model.XXXCollection)
                                    {
                                    <tr>                                                            
                                       <td>@Model.DataHere</td>
                                    </tr>
                                    }
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    

    Using
    Bootstrap and Jquery.

    From what I could find if I select Bootstrap I get also the collapse classes that are duplicated in my current bootstrap installation so this is clashing and behaving differently in DataTables. I though of renaming the classes but that doesn't feel right, any pointers?

  • allanallan Posts: 63,791Questions: 1Answers: 10,513 Site admin
    Answer ✓

    What do you mean by "taking over"? Can you link to the page so I can debug it please?

    Also, if you could use the non min version of the file to identify where the links are being attached that would be useful.

    Thanks,
    Allan

  • MeMyselfAndIMeMyselfAndI Posts: 3Questions: 1Answers: 0

    I don't want to leave this question hanging. I re-created my CSS includes and SCRIPTS and everything worked so sorry I posted the question before I was able to fix it on my own. Thanks for replying, though.

  • allanallan Posts: 63,791Questions: 1Answers: 10,513 Site admin

    No worries - thanks for posting back, and good to hear you've got it working now!

    Allan

This discussion has been closed.