开发者

Working out global tab order algorithmically?

开发者 https://www.devze.com 2022-12-26 09:34 出处:网络
We have a proprietry system where we can configure fields on indiviual forms. However these fields have a global tab order (we cannot specify for a specific form).

We have a proprietry system where we can configure fields on indiviual forms. However these fields have a global tab order (we cannot specify for a specific form).

We have a bunch of forms (35 in total) which share a lot of different fields.

Each form has a specific tab/edit order that needs to be configured.

Example:

Form 1 has fields A,B,C,D in that order.

Form 2 has fields E,开发者_Go百科F,G,A in that order.

Form 3 has fields E,B,H,I in that order.

The global tab orders would be E,F,G,A,B,C,D,H,I

Notice how A needs to come before B yet after G.

Is there any easy way to work this out using the tab order lists for each form?

I need to merge this tab order information into a single global tab order list.

I have over 200 fields in total and it is near impossible to do by hand.


I believe a topological sort ( http://en.wikipedia.org/wiki/Topological_sorting ) will fit the bill. Make a graph whose vertices are the fields and for each form, say, A,B,C,D, put edges A->B, B->C, C->D.

0

精彩评论

暂无评论...
验证码 换一张
取 消