[beta 4.0.4.] Kendo ComboBox replacing by DropDownList

Posted by Meryk on 09-Dec-2015 08:30

Hi Siraj,

As I was saying in that previous post: https://community.progress.com/community_groups/rollbase/f/25/p/21725/76816#76816, it is a bit frustrating for us to change our code again, although your changes make sense.

FYI, the main reason we are manipulating the kendoComboBox widget is for filtering, which we could not do with a RB API. So the way we did that is the following :

var comboBox= $("#opportunityType").data("filedIntName");

var _flt = { logic: "or", filters: [] };

_flt.filters.push({ field: 'code', operator: "contains", value: "myValue" });

comboBox.dataSource.filter(_flt);

Are you providing a rb API for filtering that goes with this change now ?If no, can you please suggest a way we could achieve that, ideally something we wouldn't need to change in future upgrades?  

Thank you

Meryem

Posted by Meryk on 09-Dec-2015 09:50

Alright, should be fine then if it is just this small change :)

Performance is much better. We can see that the Navigation is faster, and loading the pages and even going from new UI to old UI (object definition) pages is faster.

We are happy with that thank you !

Cheers

Meryem

All Replies

Posted by Meryk on 09-Dec-2015 08:36

Also, are they any other similar changes to other Kendo widgets in 4.0.4 ?

Posted by Mohammed Siraj on 09-Dec-2015 09:09

Meryem, Kendo DataSource is an abstraction & is not tied to any particular widget.

The filters that you are setting on kendoDataSource should work well now also.

Given below is a code snippet  that exhibits the same:

<script>

var fieldContext = rbf_getFieldContext('fieldIntegrationName');

var kConfig = fieldContext.getKendoConfig();

var _flt = { logic: "or", filters: [] };

_flt.filters.push({ field: 'code', operator: "contains", value: "Eins" });

kConfig.dataSource.filter(_flt);

</script>

Beleive the only correction you will have to make is:

Instead of,

var comboBox= $("#opportunityType").data("filedIntName");

Use:

var comboBox=  rbf_getFieldContext('fieldIntegrationName');

This will also give you performance benefits as you need not run jquery selectors on the page DOM i.e. $("#opportunityType").

That said, do you have any commments on the performance side for Rollbase 4.0.4 - Early Access Build.

Posted by Mohammed Siraj on 09-Dec-2015 09:11

There are no other similar changes in kendo widgets, as done for Rollbase Picklist fields.

Posted by Meryk on 09-Dec-2015 09:50

Alright, should be fine then if it is just this small change :)

Performance is much better. We can see that the Navigation is faster, and loading the pages and even going from new UI to old UI (object definition) pages is faster.

We are happy with that thank you !

Cheers

Meryem

Posted by Thierry Ciot on 09-Dec-2015 14:41

Glad to hear this.  And thanks for the positive feedback :) the ui team will certainly appreciate.

We will try to come up with final numbers on performance improvements.

The other performance factor we improved is for mobile devices, the amount of data transferred is greatly reduced.

Thierry.

Posted by IramK on 15-Dec-2015 10:03

Hello @Siraj,

How does the rbf_getFieldContext() work for a kendo Numeric TextBox field? Could you suggest an alternative to this so that we don't use:

var numericTextBox = $("input[name='numericTextBox']").data("kendoNumericTextBox");

var numericTextBox = rbf_getFieldContext('numericIntName'); // doesn't really work..

Cheers.

Iram

Posted by Mohammed Siraj on 15-Dec-2015 10:43

Iram, can you please re-confirm. rbf_getFieldContext API should work for Numeric fields as well i.e. Integer, Decimal, Percent & Currency.

Some minor corrections  in above snippet:

//to access related kendo configuration object, we need to call getKendoConfig() on fieldContext object.

var numericTextBox = rbf_getFieldContext('numericIntName').getKendoConfig();

Can you also double check the integration name, is it 'numericIntName' or 'numericTextBox';

Posted by IramK on 16-Dec-2015 06:12

Hello Siraj,

I have checked the numericTextBox field and as you said I think it works correctly. However now I have another issue relating to this:

Basically if we replace all the instances of .data("kendoSomething") to rbf_getFieldContext("SomethingsIntName"), would we be able to use the standard kendo function calls like: .enable(), .readonly() etc because we are using that quite a lot everywhere and would like to know what we could use as replacements. Kindly let me know.

Cheers.

Iram

Posted by Mohammed Siraj on 16-Dec-2015 08:54

Iram,

inputEl.data("kendoSomething") & rbf_getFieldContext("fieldIntegrationName").getKendoConfig() will both result in the SAME kendo control configuration object. So any further chaining of methods will NOT be affected i.e. enable() or readOnly().

Advantages with rbf_getFieldContext approach:

It will execute faster as jquery node reference is part of fieldContext object state.

It will not have any comptability issues across releases & also does not impose any requirement on user to know about exact kendo widget i.e kendoNumericTextbox or kendoDropdownList or kendoMaskedTextBox.

Note that rbf_getFieldContext(fieldIntegrationName) will not give you kendo control configuration object. It is a root level field context object which enapsulates state & behavior of the given field. You need to call getKendoConfig() on this fieldContext object to access the kendo control configuration.

Eg:  rbf_getFieldContext("fieldIntegrationName").getKendoConfig()

Posted by IramK on 16-Dec-2015 09:13

That's great to know and learn. This works properly now with the .getKendoConfig() appended to the field context. Thanks for the answer.

Is there going to be some documentation on rbf_getFieldContext() and similar functions that could be useful to everyone? Kindly let me know.

Cheers.

Iram

Posted by Mohammed Siraj on 16-Dec-2015 11:12

Glad that you found it useful Iram. Going forward we will be introducing detailed Client-side SDK documentation to educate users of such Client-side API enhancements with NewUI revision.

In the interim will also post knowledge articles regarding the same in this Community forum.

This thread is closed