This is a migrated thread and some comments may be shown as answers.

Tag Helpers CRUD

1 Answer 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sayitfast
Top achievements
Rank 2
Iron
sayitfast asked on 28 Jun 2018, 10:59 PM

I have the following configuration of the Grid:

<kendo-grid name="grid">
    <datasource type="DataSourceTagHelperType.Custom" page-size="5">
        <transport>
            <read url="https://thefishroommvccore.azurewebsites.net/api/PageContents"  />
            <destroy url="https://thefishroommvccore.azurewebsites.net/api/PageContents/7"  />
        </transport>
        <schema>
            <model id="Id">
                <fields>
                    <field name="Name" type="text"></field>
                    <field name="Content" type="text"></field>
                    <field name="PublishDateTime" type="date"></field>
                </fields>
            </model>
            <model>
                <fields>
                    <field name="PublishDateTime" type="Date"></field>
                </fields>
            </model>
        </schema>
    </datasource>
    <groupable enabled="true" />
    <sortable enabled="true" />
    <pageable button-count="5" refresh="true" page-sizes="new int[] { 5, 10, 20 }">
    </pageable>
    <filterable enabled="true" />
    <columns>
        <column field="Name" title="Name" width="240" />
        <column field="Content" title="Content" width="240" />
        <column field="PublishDateTime" title="Date" format="{0:MM/dd/yyyy}" />
        <column field="Id" title="Id" width="150" />
        <column title="Edit">
            <commands>
                <column-command name="edit"></column-command>
                <column-command name="delete" name="destroy"></column-command>
            </commands>
        </column>
    </columns>
</kendo-grid>

 

I can view sort all works... the one thing I cannot get to work is the delete which I have hard coded right now to delete record with Id of 7.  I'm following the docs at: https://docs.telerik.com/aspnet-core/helpers/tag-helpers/grid

Right now Delete is doing nothing... no errors in page nothing.  I don't understand what it is I need to do to delete a record. The service is just a Web Api with Crud.  I can do Crud operations in Postman no problem.

 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 03 Jul 2018, 06:23 AM
Hello, Rhett,

Thank you for the details.

If the Grid is using WepApi, the dataSource type has to be set to WepApi as well.

I can suggest checking the dataSource tag helper documentation as it has some specifics which have to be taken into account when using it:

https://docs.telerik.com/aspnet-core/helpers/tag-helpers/datasource#basic-usage

If the issue still occurs please provide an example and I will gladly investigate further.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
sayitfast
Top achievements
Rank 2
Iron
Answers by
Stefan
Telerik team
Share this question
or