Do not load all pictures on grid load

QuestionsDo not load all pictures on grid load
Azam asked 5 years ago

Hello, Abu Gufran!

I have a hidden column with pictures on it. It can be seen only on view action. Is it possible to load picture only when the certain row is selected to view? I mean not to load all pictures (to decrease traffic and page loading time) at grid load, but one by one only if any row is selected to been viewed.
Thanks!

1 Answers
Abu Ghufran answered 5 years ago

The images are usually displayed using <img> tag html in grid column.
So instead of setting src attribute, you can set some src-tmp attribute with image path.

And on view_option beforeShowForm event, set src-tmp attribute to img src.

$opts["view_options"]["beforeShowForm"] = 'function(formid) { ….. }';

Inside function you can invoke jquery code to set all img tag src attribute which are inside formid.

This is just to give an idea. I've not tested and verified this approach.

Your Answer

3 + 15 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?