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

[Solved] disable automatic binding

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
david
Top achievements
Rank 1
david asked on 28 Jul 2011, 08:43 AM
hi,
i'm using ajax databinding on my grid - however i want to manually perform the ajaxRequest in JS.  at the moment, its calling the ajaxRequest twice, because i call it manually and its automatically called.

my grid has:

.EnableCustomBinding(true)
.DataBinding(ajax => ajax.Ajax().Select(Model.AjaxCallBack, "Home"))

my binding method in the controller has:

[GridAction(EnableCustomBinding = true)]

How can i stop the automatic databinding?

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 28 Jul 2011, 09:21 AM
Hi David,

 You can do so by preventing the OnDataBinding event the first time:

var first = true;
 
function onDataBinding(e) {
  if (first) {
     first = false;
     e.preventDefault();
  }
}

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Tags
Grid
Asked by
david
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or