help with editable report and javascript

(7 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 :)

  4. ziuras, Member

    Hi, another question
    i have report similar:
    ~~~

    select 'dbr.report', 'sp_DBR_Detail', 'new_popup', '[new_popup]', '[Counts]', 'Sku=[Sku]', 'Date=[DateM]', 'event=click', 'show_link=[Counts]!=0'
    select 'dbr.crosstab', 'DateM'
    select 'A' as Sku, '2025-01' as DateM, 0 as Counts
    union select 'A' as Sku, '2025-02' as DateM, 1 as Counts
    union select 'A' as Sku, '2025-03' as DateM, 0 as Counts
    union select 'B' as Sku, '2025-01' as DateM, 2 as Counts
    union select 'B' as Sku, '2025-02' as DateM, 0 as Counts
    union select 'B' as Sku, '2025-03' as DateM, 3 as Counts

    ~~~
    And link is showing randomly on Counts.
    Can you help me?

  5. myDBR Team, Key Master

    We'll take a look at it.

    --
    myDBR Team

  6. myDBR Team, Key Master

    The issue is fixed in the latest build — just run the automatic updater.

    --
    myDBR Team

  7. ziuras, Member

    Thanks


Reply

You must log in to post.