0

I have the read function, i want to make sure that value for parameter is present, if not cancel the read event. How can i cancel the ajax Call from within Read ?

read: {
            url: function (e) {
                try {
                    //var OrgHeadQrtrID_PK = 0;

                    if (e.orgHeadQuarterIdPK == null)
                        **--not sure how to cancel this read**

                    return baseURL + "/GetOrgs";

                } catch (e) {
                    console.error("Error occured in the read method of module " + moduleName);
                    console.trace();
                }


            }, // "/PutOrgSchool",
NSS
  • 1,835
  • 2
  • 29
  • 66

2 Answers2

1
  requestStart: function (e) {
            e.preventDefault();
        }
    }

use e.preventDefault(); to prevent a read request, however create/update/destroy requests cannot be prevented. You can set these options as functions and prevent them manually. How to set them to a function is explained here:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-transport.create

Arun
  • 145
  • 1
  • 7
0

I don't think you can cancel it from the read function, but you can from requestStart however, I'm not sure you can get the parameters from there.

CodingWithSpike
  • 42,906
  • 18
  • 101
  • 138