On 30 May 2012 12:59, R. Osinga <[email protected]> wrote:

> beats me...
>
> I have determined that it is unrelated to this code.  I see it elsewhere
in the app also.


> but for some other improvement,
>
> $(document).ready(function() {
>      $('a[href*="Alternative"]').a**ttr('data-toggle','modal').a**ttr(
> 'data-target','#alt');
> });
>
> Thanks again.

This function is now doing it's job and the dom is marked as requested.
But the result bypasses the modal-part.  I suspect that I will have to find
another way to trigger the modal-function of bootstrap for example just a
clickable element.  I do not (yet) know how to pass the correct variable
from the row to the modal function in such a case.

I have now

<a id="merkmy" href="/init/journal/alternatives/8161"
data-toggle="modal" data-target="#alt">Alternative name(s)</a>

in the grid

and I have changed my jquery script to:


<script>
    $(document).ready(function() {
    $('#merkmy').attr({
        'data-toggle': 'modal',
        'data-target': '#alt'
    });


    $("a[data-toggle=modal]").click(function() {
        event.preventDefault();
        target = $(this).attr('data-target');
        url = $(this).attr('href');
        $(target).load(url);
        return false;
    });
});
</script>

But when I click on the link, it calls up the normal page with the data -
no modal.

I still have a lot to learn about jquery!

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

Reply via email to