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

RadFilter changeExpressionFieldName: ownerIndex

1 Answer 20 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Calvin Ang
Top achievements
Rank 1
Calvin Ang asked on 03 May 2013, 05:07 PM
Hi there,

The documentation for RadFilter indicates that the following client-side function is available:

changeExpressionFieldName(ownerIndex, fieldName)

Method which changes the field name of the expression at the level specified by theownerIndex parameter to the value of the fieldName parameter.


I was able to try out this function by plugging in the end of the ID of  the "LI" element corresponding to the expression to be changed for ownerIndex, e.g., "0_0."

Is there a more elegant way to determine the owner index of a given expression? 

Thanks,
Calvin

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 08 May 2013, 12:05 PM
Hi Calvin,

Thank you for contacting us.

Currently, there is no more convenient approach than the suggested one:
function changeFieldName() {
    var filter = $find("<%= RadFilter1.ClientID %>");
    filter._filterCommandInternal("ChangeExpressionFieldName", "0_0", "OrderDate");
}

You can also access and traverse the expressions collection object:
filter._expressionItems
Or get the OrderIndex of the expression by its element id:
expressionEl.id.split("__")[1];

Additionally, please note that for the coming Q2 2013 release, our developers have re-builded the RadFilter control which will expose many new properties and will provide richer and much more convenient interface to be customized.

Hope this helps.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Filter
Asked by
Calvin Ang
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or