Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1175
Some Client-side questions
posted

Hello there,

as you might have seen from other threads, I have to do some work with javascript.

I have some points where I cant see a solution but I guess, the webdatagrid can solve this:

On the edit mode, I want the editing template to overlay the clicked row. So before entering the edit mode, I save the original height and set this as Margin-Top after showing.

Here is the javascript function:

        function enterRolesEditMode(btnClientId) {
            var btn = document.getElementById(btnClientId);
            var origTrHeight = $(btn).closest('tr').height();

            GridRowEnterEditMode(btn, 'EditRole');
            var templateId = $find('dgrRoles').get_behaviors().get_editingCore()._behaviors._behaviors[0]._templateId;
            var divToChange = $('#' + templateId).children('div');
            divToChange.css('margin-top', "-" + origTrHeight + "px");
        }

It works not bad, but the height doesnt seem to fit the real height of the row, since there are small stripes of the underlayed row shown.

Is there a possibity per grid to find the correct height? the JQuery height doesnt seem to fit.

Second case:

I have troubles removing empty rows (which I create as hack for the hierarchical grid case), my approach is something like this:

        function RemoveRoleAttributeGridRow(previousBtnClientId) {
            var btn = $('#' + previousBtnClientId);
            var tr = btn.closest('tr');
            tr.next('tr').remove();
        }

It would work, but the timing is wrong since I dont have the information I need at this time. Is there a easy solution for something like 'GetEmptyRows'?

Thanks for your response and a good start in the week!

Matthias