cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically set Grid properties (columns/rows) ?

alfons_gonzalez
Active Participant
0 Kudos

Hi,

I am trying to establish dynamically the number of columns and rows of a given grid components. I have been considering 2 approaches:

     - DS Components API

     - Grid component properties databinding

Any of 2 options seems to be feasible (no methods on API; greied Property Binding)

Someone has an idea of achieving this goal if possible?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Alfons,

Why would you require to change the number of rows and columns ?

I I am asking because I wanted to dynamically generate components in DS, and therefore, using a dynamic grid, with dynamic placement would have been great.

Unfortunately, DS does not support this feature as of now if I am not mistaken. Only some configurable components do.

I think there is now way to do that. A better bet would be to check Responsive design using CSS and Relative positioning (using Float). This way, you can achieve a "fiori" look and basically have a dynamic table in you DS application.

alfons_gonzalez
Active Participant
0 Kudos

Hi,

The reason of my question is that we would like to use the grid component  with a number of columns that may depend of dynamic values calculated on basis of data set query results (e.g:the grid would be use to place elements).

Probably we were trying to do something similar to you are looking for.

I suspect that currently only Custom Component Development (based on DS SDK) may provide some way to achieve my requirement.

Thanks,

former_member187102
Participant
0 Kudos

By default creating maximum number of rows and deleting the unwanted rows on startup will make the row count dynamic (similar for columns).

The below example is done with the SDK addon:

GRID_LAYOUT_1_grid for grid having name "GRID_LAYOUT_1"


The below code deletes second row of the grid:

document.getElementById('GRID_LAYOUT_1_grid').deleteRow(1);

It though lags a feature on dynamically setting the code, its available on other components

Former Member
0 Kudos

Relaying on dynamic javascript coding to alter the page structure is a risky bet as you'll need to reapplay those statements each time the page is refreshed, you have to control you'll be selecting the correct line etc ...

It not impossible, but risky IMO.

For instance, I would say the HTML container extension is best to achieve what you want, instead of using the grid layout (IMO).


Also, have a look at the LaunchPad from Mike (available with the SDN Community package):

A collection of tile, arranged as a table, responsive and customizable by script !

former_member187102
Participant
0 Kudos

Yes Franck, its really risky option. I suggested it, as there is no other alternative apart from that i can see..

alfons_gonzalez
Active Participant
0 Kudos

Thanks Franck,

I have considered the differents options you suggest and using the fiori-like launchpad is the one that I prefer. Thanks for the info.

Just a general doubt with regards of using this kind of components (SDN community package) -this point would probably deserves another topic- : do you think that it is a good practice to use this components on a end-user production environment? i mean, we already know that SAP does not support them. Do you think that the risk of having future issues may be minimized (e.g: problems with future DS releases)?

Former Member
0 Kudos

Hello Alfons,

I am a BI consultant, and I do not hesitate to encourage my customers to use those extensions they have a very low risk associated to it. Of course, it depends on the component.


The component has been tested on 1.5, and apart major changements in the core logic of DS, updates should not break it.

If it happens, customer UAT should spot them. If you encounter any issue, you can post it on our Github issue log and the members will look into it quickly. Especially Karol and Mike are amazing contributors and skillful developers.

Unfortunately, as you stated, SAP will not support them, but it encourages developers to create those extensions. So why not using them ?

You could copy this extension (Apache 2.0 Licence, little to no string attached) and make it yours. This way, you would have full control on it.

former_member187102
Participant
0 Kudos

             There is a detailed blog series by available in you can further customize the scn components. Also there are available commercially with full support.

mike_howles4
Active Contributor
0 Kudos

Bad idea.

former_member187102
Participant
0 Kudos

which one you mean as Bad idea..

mike_howles4
Active Contributor
0 Kudos

Thanks for that sentiment, Franck.

SCN Community Components are certainly not defect-free, but neither is Design Studio, to be completely fair. 


Alfons,

This particular discussion actually provokes a slight tangent I will take for just a moment...  Also do not take this rant personal, I'm not taking open source risk-aversion personal either, but just my thoughts:

I'd say maybe support helps an immediate how-to need 25% of the time, and the remaining 75% of the time, it's a product gap, or a bug that will get incorporated into a patch of support pack down the road.

On the other side, Open Source carries no assurances, however there's nothing prohibiting you from forking the code and fixing/owning one's self ASAP, or putting in a GitHub issue and seeing how your luck goes with support from the community (who is always looking for more contributors)

My point is, that official support is certainly a factor to weigh, but also weigh turnaround time and flexibility of open source.

So ask yourself "Am I restricting myself because something might break, and I do not have a neck to choke, or will I restrict myself to lowest common denominator baseline components?"

mike_howles4
Active Contributor
0 Kudos

DOM hacking outside of your extension's own DIV container is a bad idea.

alfons_gonzalez
Active Participant
0 Kudos

Hi Mike,

I completely agree your point of view. The last question is exactly the one that I have used in my company to justify the use of these components to rebate tcriticisms about potential "isssues" in the future.

Let me take the chance tof acknowledge your contribution and effort to the development of this components.

Thanks,

Answers (0)