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

KendoUI with custom architecture - flexibility

3 Answers 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mirek
Top achievements
Rank 1
Mirek asked on 10 Aug 2015, 06:56 AM
Hello,
I'm new to Kendo UI and I have some questions

currently we're searching for UI components for webapp(JS) and we're considering Kendo UI
We have desktop app(fat client) and we want "rewrite it" in special way. It means that we created some abstraction layer and our developers create views like this:

def customerView = view.add(Customer.VIEW_NAME)
def customer PersonView = view.add(CustomerPerson.VIEW_NAME)

view.addColumn(customerView.getCoulmn(Customer.Columns.FIRST_NAME))
view.addColumn(customerView.getCoulmn(Customer.Columns.LAST_NAME))
customerView.join(customer PersonView)
view.add Column(customerPersonView.getCoulmn(CustomerPerson.Columns.BRANCH_NAME))

As you can see this is declarative way of programing. We can interprete in any way. We want publish this declarative code as JSON and write intepreter in javascript with Kendo UI as View. As you can see we want use Kendo in non standard way.

Currently we have following questions:

1) In data presentation component can we pass our functions to handle data fetching from backend?

In example http://demos.telerik.com/kendo-ui/grid/remote-data-binding
we can pass link to data
 transport: {
                                read: "//demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
                            },
this solution is very comfortable but not for us. We want pass some function which get all the filters, column's orders, visible columns and page no. and returns some data

2) In Kendo UI we have Model and Observables. Can we pass some adapter to it?
In our app we have our Models and we don't want to convert it to Kendo UI models (two source of data), we want pass adapter function like this

var ourAppModel = new NextModel();

var kendoAdapter ={
setValue:function(fieldName, val){
ourAppModel.fireDataChange(fieldName, val)
}
getValue: :function(fieldName, val){
return ourAppModel.get(fieldName, val)
}
}

var kendoModel = new KendoModelAdapter(kendoAdapter)
ect

3) Finnaly is Kendo UI is good choice for us :-). We want write app creating core app logic in Javascript with our model, our controller and our views (aka delegation).
Then in views wrap vendor components (Kendo UI) which means that we need very flexible library which not force on us some special solutions. In other words we want to change vendor as we like rewriteing only glue code (model's adapters, event's adapters)


Best regards
Mirek

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 11 Aug 2015, 08:44 AM

Hello Mirek,

regarding your first question - the transport.read configuration option may be a function, implementing the so called custom transport. There is plenty of information and several sample implementations available in our forums of that pattern. 

As per the second one - you may be able to reverse-engineer our MVVM implementation and support the necessary protocol. The code is available here for your reference. However, this is a very complex approach, and it may reach too deep in the framework internals, potentially causing lots of headaches with upgrades where we optimize these parts. A thing you may do In order to stay vendor-agnostic is to implement a custom simple two-way data binding which will abstract your model structure from the format required by our widgets. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Mirek
Top achievements
Rank 1
answered on 12 Aug 2015, 08:53 AM
Thanks for answer what about with point 3
0
Petyo
Telerik team
answered on 12 Aug 2015, 09:10 AM

Hello Mirek,

 

the answer to my second point covers the concerns in point 3, too. Going with your own MVC implementation is necessary, should you decide to be vendor agnostic.

 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Mirek
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Mirek
Top achievements
Rank 1
Share this question
or