The Edit / Details / Delete icon does not appear in the column

The Edit / Details / Delete icon does not appear in the column

al3bodyal3body Posts: 12Questions: 4Answers: 0

Hello
Unable to show icon
Edit / Details / Delete
Next to each record in the column

I use
asp.net mvc

The code is included for modification

The Edit / Details / Delete icon does not appear in the column

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    It looks like your columns aren't aligned. The columns displays Id for the first, and Twseiat for the last.

    Colin

  • al3bodyal3body Posts: 12Questions: 4Answers: 0

    Thanks for the answer

    Sorry
    I didn't know how to do the alignment columns

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    edited September 2020 Answer ✓

    Are you saying that this is now fixed?
    If not - your HTML columns need to match your js "columns" definition. Your HTML is missing an "Id" column.

  • al3bodyal3body Posts: 12Questions: 4Answers: 0

    It hasn't been fixed.

    unable to act as a court.

  • al3bodyal3body Posts: 12Questions: 4Answers: 0

    اسف
    لم يتم اصلاح المشكله
    لم اعرف طريقة عمل المحاذا

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    your HTML columns need to match your js "columns" definition. Your HTML is missing an "Id" column.

    What part of that do you not understand?

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    By aligned, I mean they don't match. The data, the HTML and the column configuration must all be consistent - and in that file you sent that's not the case.

    Colin

  • al3bodyal3body Posts: 12Questions: 4Answers: 0

    very sorry

    This code is included in the editor

    http://live.datatables.net/piluzaro/1/edit

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    I think you're not understanding what we're saying...

    You have initialised columns with 7 values:

                    "columns": [
                        { "data": "Id", "autowidth": true },
                        { "data": "Name", "autowidth": true },
                        { "data": "Code", "autowidth": true },
                        { "data": "Note", "autowidth": true },
                        { "data": "Enakad", "autowidth": true },
                        { "data": "Ftra", "autowidth": true },
                        { "data": "Mhawer", "autowidth": true },
                                          
                    ],
    

    But your header and the body has 9 columns:

                <thead>
                    <tr>
                        <th>
                            @Html.DisplayNameFor(model => model.Id)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.Name)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.Code)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.Note)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.Enakad)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.Ftra)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.Mhawer)
                        </th>
                        <th>
                            @Html.DisplayNameFor(model => model.Twseiat)
                        </th>
    
                        <th>Edit/Details/Delete</th>
    
                    </tr>
    
    
                </thead>
    

    These need to be the same...

    Colin

  • al3bodyal3body Posts: 12Questions: 4Answers: 0

    Thank you so much

This discussion has been closed.