help with editable report and javascript

(3 posts) (2 voices)

Tags:

No tags yet.

  1. ziuras, Member

    Hi,
    I have report:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    select 'dbr.javascript', " function valid1(obj) { if ($(obj).parent().children().eq(1).text() == '1') return true; }";

    select 'dbr.report', 'sp_DBR_Edit', '[cmdEdit]', 'scriptdiv[]', 'id=ID', 'txt<=txt', 'event=click', 'callbefore=valid1';

    select txt, editable, case when editable = '1' then 'dbr.purehtml:<div class="i_edit"></div>' else '' end as '[cmdEdit]'
    from (
    select 1 as ID, 'aaaaaa' as txt, '0' as editable
    union
    select 2 as ID, 'bbbbbb' as txt, '1' as editable
    union
    select 3 as ID, 'cccccc' as txt, '0' as editable
    ) as t1
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    and i want that [cmdEdit] buton will work only on rows where editable=1 but i want to hide editable column from table.

  2. myDBR Team, Key Master

    No need for the JavaScript or the callback. You can use the show_link-option.

    select 'dbr.hidecolumn', 'editable';
    select 'dbr.report', 'sp_DBR_Edit', '[cmdEdit]', 'scriptdiv[]', 'id=ID', 'txt<=txt', 'event=click', 'show_link=[editable]==1';

    --
    myDBR Team

  3. ziuras, Member

    Thank you, i forgot this method :)


Reply

You must log in to post.