get_masterTableView client side does not work

14 posts, 0 answers
  1. Fabio Laserra
    Fabio Laserra avatar
    28 posts
    Member since:
    Oct 2009

    Posted 05 Oct 2011 Link to this post

    hello
    I have a radgrid with edittemplate controls in which there is a radasyncupload. When I upload a file I want to disable the Update button. So I have this code:


    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
    alert("1");
    var masterTable = $find('<%=rdgrd_Rassegna.ClientID%>').get_masterTableView();
    alert("2");
     </script>
     </telerik:RadScriptBlock>

    I can get no references to mastertableview, I see alert 1 but no alert 2.Where I am wrong?

    Thanks

  2. Jayesh Goyani
    Jayesh Goyani avatar
    2595 posts
    Member since:
    May 2010

    Posted 05 Oct 2011 Link to this post

    Hello,

    please try with below code and let me know are you able to find grid/Mastertableview or not?

     var grid = $find("<%=RadGrid1.ClientID %>");
     if (grid) {
    alert('grid found');
                        var MasterTable = grid.get_masterTableView();

    }
    else
    {
    alert('grid not found');
    }

    Thanks,
    Jayesh Goyani

  3. Fabio Laserra
    Fabio Laserra avatar
    28 posts
    Member since:
    Oct 2009

    Posted 06 Oct 2011 Link to this post

    Hello,
    thank you for your reply!

    It says grid not found. The code is written in FormTemplate:

    <EditFormSettings EditFormType="Template">
                <FormTemplate>

    I have tried also to disable ajax (so the grid makes a complete page reload for each request) but the result is exactly the same! I didn't say that this is a part of DNN 6 pro module... I don't know if it can help to investigate the issue...

  4. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3375 posts
    Member since:
    Sep 2012

    Posted 09 Oct 2011 Link to this post

    Hi Fabio,

    If the provided script block is in the FormTemplate, try accessing the MasterTableView as below:

    var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");

    However, you mentioned that you need to disable the update button. I am not sure that in this case you need reference to the MasterTableView at all. Can you share the whole grid declaration and specify on which event you want to disable the Update button?

    Best wishes,
    Iana Tsolova
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

  5. Fabio Laserra
    Fabio Laserra avatar
    28 posts
    Member since:
    Oct 2009

    Posted 10 Oct 2011 Link to this post

    Hello Iana,
    I don' know why, but the problem is the $find method, it always return null. If I use this:

    var tableView = document.getElementById("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>")

    the tableview is references without issues. So if I use one of the following a NULL object returns:

    var tableView = $find('dnn_ctr463_RassegnaStampa_rdgrd_Rassegna') // the real clientid
    var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>")


    Well, I need to disable Update and Cancel buttons while uploading files with asyncupload. And I need also to reference two radlistboxes because I want to limit (with javascript) the number of elements that I can move from a list to the other. This is the code of formtemplate:

    <EditFormSettings EditFormType="Template">
                <FormTemplate>
                    <table border="0" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none"
                        style="border-collapse: collapse">
                        <tr class="EditFormHeader">
                            <td colspan="2">
                                <b>Dettaglio Notizia</b>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table border="0" cellspacing="1" cellpadding="1" width="100%" border="0">
                                    <tr>
                                        <td>
                                            Titolo:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtTitolo" MaxLength="150" runat="server" Text='<%# Bind("Titolo") %>'>
                                            </asp:TextBox>
                                            <asp:RequiredFieldValidator ID="reqTitolo" ControlToValidate="txtTitolo" ErrorMessage="*"
                                                runat="server">
                                            </asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Testata:
                                        </td>
                                        <td>
                                            <telerik:RadComboBox ID="RadComboBoxTestata" runat="server" DataSourceID="objDataSourceTestate"
                                                Filter="Contains" DataTextField="Descrizione" DataValueField="ItemID" SelectedValue='<%# Bind("CodTestata") %>'>
                                            </telerik:RadComboBox>
                                            <asp:CompareValidator ID="compareTestata" ControlToValidate="RadComboBoxTestata"
                                                ValueToCompare="1" Operator="GreaterThanEqual" ErrorMessage="*" runat="server">
                                            </asp:CompareValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Data:
                                        </td>
                                        <td>
                                            <telerik:RadDatePicker ID="RadDatePickerData" DatePopupButton-Visible="true" ShowPopupOnFocus="true"
                                                runat="server" SelectedDate='<%# Bind("Data")%>'>
                                            </telerik:RadDatePicker>
                                            <asp:RequiredFieldValidator ID="reqData" ControlToValidate="RadDatePickerData" ErrorMessage="*"
                                                runat="server">
                                            </asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Riservata:
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="chkFlgRiservata" runat="server" Checked='<%# Bind("FlgRiservata") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table border="0" width="100%">
                                                <tr>
                                                    <td style="width: 50%;">
                                                        Argomenti: (max 3)<br />
                                                        <telerik:RadListBox ID="RadListBoxArgomentiLiberi" runat="server" Width="200px" Height="200px"
                                                            SelectionMode="Multiple" AllowTransfer="true" TransferToID="RadListBoxArgomentiSelezionati"
                                                            AutoPostBackOnTransfer="false" AllowReorder="false" EnableDragAndDrop="true"
                                                            DataSourceID="objDataSourceGridNotizie_ArgomentiLiberi" DataKeyField="ItemID"
                                                            DataTextField="Descrizione" DataValueField="ItemID">
                                                        </telerik:RadListBox>
                                                        <telerik:RadListBox ID="RadListBoxArgomentiSelezionati" runat="server" Width="200px"
                                                            Height="200px" SelectionMode="Multiple" AllowReorder="true" AutoPostBackOnReorder="false"
                                                            AutoPostBackOnTransfer="false" EnableDragAndDrop="true" DataSourceID="objDataSourceGridNotizie_Argomenti"
                                                            DataKeyField="CodArgomento" DataTextField="Descrizione" DataValueField="CodArgomento">
                                                        </telerik:RadListBox>
                                                    </td>
                                                    <td style="width: 50%;">
                                                        Tags: (max 3)<br />
                                                        <telerik:RadListBox ID="RadListBoxTagsLiberi" runat="server" Width="200px" Height="200px"
                                                            SelectionMode="Multiple" AllowTransfer="true" TransferToID="RadListBoxTagsSelezionati"
                                                            AutoPostBackOnTransfer="false" AllowReorder="false" EnableDragAndDrop="true"
                                                            DataSourceID="objDataSourceGridNotizie_TagsLiberi" DataKeyField="ItemID" DataTextField="Descrizione"
                                                            DataValueField="ItemID">
                                                        </telerik:RadListBox>
                                                        <telerik:RadListBox ID="RadListBoxTagsSelezionati" runat="server" Width="200px" Height="200px"
                                                            SelectionMode="Multiple" AllowReorder="true" AutoPostBackOnReorder="false" AutoPostBackOnTransfer="false"
                                                            EnableDragAndDrop="true" DataSourceID="objDataSourceGridNotizie_Tags" DataKeyField="CodTag"
                                                            DataValueField="CodTag" DataTextField="Descrizione">
                                                        </telerik:RadListBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Percorso attuale file:
                                <asp:Label ID="lblPercorsoNotizia" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <telerik:RadScriptBlock ID="test" runat="server">
     
                                    <script type="text/javascript">
                                    
                                        
                                        var tableView = document.getElementById("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>")
                                        if (tableView) {
                                            alert('grid found');
                                        }
                                        else {
                                            alert('grid not found');
                                        }
                                         
                                         
                                         
                                    </script>
     
                                </telerik:RadScriptBlock>
                                <telerik:RadAsyncUpload AllowedFileExtensions="pdf" AutoAddFileInputs="false" Localization-Cancel="Annulla"
                                    Localization-Remove="Rimuovi" Localization-Select="Seleziona" MaxFileInputsCount="1"
                                    MultipleFileSelection="Disabled" runat="server" ID="AsyncUploadNotizia" Skin="Office2007"
                                    OnClientFileUploadFailed="onUploadFailed" OnClientFileSelected="onFileSelected"
                                    OnClientFileUploaded="onFileUploaded" TemporaryFolder="~/App_Data/RadUploadTemp"
                                    InputSize="50" Culture="it-IT">
                                </telerik:RadAsyncUpload>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2">
                                <telerik:RadButton ID="btnUpdate" runat="server" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Inserisci", "Aggiorna") %>'
                                    CssClass="MyImageButton" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>
                                </telerik:RadButton>
                                <telerik:RadButton ID="btnCancel" Text="Annulla" runat="server" CausesValidation="False"
                                    CommandName="Cancel">
                                </telerik:RadButton>
                            </td>
                        </tr>
                    </table>
                    <telerik:RadDatePicker ID="RadDatePickerData_OldValue" DatePopupButton-Visible="true"
                        ShowPopupOnFocus="true" runat="server" Visible="false">
                    </telerik:RadDatePicker>
                    <asp:CheckBox ID="chkFlgRiservata_OldValue" runat="server" Visible="false" />
                    <asp:TextBox ID="txtTitolo_OldValue" Visible="false" MaxLength="150" runat="server">
                    </asp:TextBox>
                    <asp:HiddenField ID="hidFileIDPubblico" runat="server" Value='<%# Bind("FileIDPubblico") %>' />
                    <asp:HiddenField ID="hidDocumentIDRiservato" runat="server" Value='<%# Bind("DocumentIDRiservato") %>' />
                    <asp:HiddenField ID="hidFileIDPubblico_OldValue" runat="server" Value="0" />
                    <asp:HiddenField ID="hidDocumentIDRiservato_OldValue" runat="server" Value="0" />
     
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
     
        <script type="text/javascript">
     
            var $ = $telerik.$;
            var uploadsInProgress = 0;
     
            function onFileSelected(sender, args) {
                //alert("kkk");
                if (!uploadsInProgress)
                    $("#btnUpdate").attr("disabled", "disabled");
     
                uploadsInProgress++;
            }
     
            function onFileUploaded(sender, args) {
                decrementUploadsInProgress();
            }
     
            function onUploadFailed(sender, args) {
                decrementUploadsInProgress();
            }
     
            function decrementUploadsInProgress() {
                uploadsInProgress--;
     
                if (!uploadsInProgress)
                    $("#btnUpdate").removeAttr("disabled");
            }
                 
     
             
        </script>
     
    </telerik:RadScriptBlock>
     
    </FormTemplate>
    <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column">
    </EditColumn>
    </EditFormSettings>

    While I transfer a file, the button is not disabled. I think that it depends of the fact that the find function (and $) does not work at all. Can you give me a feedback?

    Thanks for your support

  6. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3375 posts
    Member since:
    Sep 2012

    Posted 11 Oct 2011 Link to this post

    Hello Fabio,

    What if you change the code for finding the tableView as below:

    var grid= $find("<%# TryCast(Container,GridItem).OwnerTableView.OwnerGrid.ClientID %>");
    var tableView = grid.get_masterTableView();


    Greetings,
    Iana Tsolova
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

  7. Fabio Laserra
    Fabio Laserra avatar
    28 posts
    Member since:
    Oct 2009

    Posted 15 Oct 2011 Link to this post

    It's exactly the same thing... grid is null... :(
    perhaps it is an issue related to an incompatibility with dnn 6...

  8. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3375 posts
    Member since:
    Sep 2012

    Posted 16 Oct 2011 Link to this post

    Hello Fabio,

    RadGrid for ASP.NET AJAX is compatible with DNN 6. However, I suggest that you open a formal support ticket and send me there the files for the module so I can perform further testing on youe exact scenario.

    Greetings,
    Iana Tsolova
    the Telerik team

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

  9. Fabio Laserra
    Fabio Laserra avatar
    28 posts
    Member since:
    Oct 2009

    Posted 17 Oct 2011 Link to this post

    Iana,
    I am a customer of DNN, I bought 6 PRO that includes telerik engine. Can I open anyway support ticket with telerik? If so, how can I do?

    Thanks
    Fabio

  10. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3375 posts
    Member since:
    Sep 2012

    Posted 17 Oct 2011 Link to this post

    Hi Fabio,

    Currently you have a trial license for RadControls for ASP.NET AJAX, so you can open support ticket. For that purpose, log in to your Telerik account, go to Your Account page from the link located on the right top of the page, from the Quick links on the right menu select "Get Support" and on the next page choose "Contact Support Team".

    Kind regards,
    Iana Tsolova
    the Telerik team

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

  11. Fabio Laserra
    Fabio Laserra avatar
    28 posts
    Member since:
    Oct 2009

    Posted 17 Oct 2011 Link to this post

    Ok but after the trial expiration? DNN customers have support for telerik products or a discount in order to buy it?

    Thanks
    Fabio

  12. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3375 posts
    Member since:
    Sep 2012

    Posted 17 Oct 2011 Link to this post

    Hello Fabio,

    You do not automatically get valid subscription for our controls. For a discount, please contact sales, by opening Sales Feedback for instance.

    All the best,
    Iana Tsolova
    the Telerik team

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

  13. Mario
    Mario avatar
    24 posts
    Member since:
    Oct 2011

    Posted 17 Oct 2011 Link to this post

    Done some days ago, but I didn' received any feedback at all...

  14. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3375 posts
    Member since:
    Sep 2012

    Posted 18 Oct 2011 Link to this post

    Hi Mario,

    You can try writing again or contact them on the phone: +1-888-365-2779

    Best wishes,
    Iana Tsolova
    the Telerik team

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

Back to Top