Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
273 views
My RadGrid contains select checkbox in all of its rows . what i am trying to do is, the user can select the row which he wants to be in page which is going to be printed or converted to pdf. Currently the website will be intranet website so i cannot acess webresourceurl.
So user can print the radgrid or save it as pdf for all the rows which have the checkbox selected. this setup is repeated 30 times in a page . i am currently binding the data in asp table for printing option and to radgrid for pdf option. hence the page is getting very bulk. can anybody help me to reduce this jumble. so i can implement the print, convert to pdf, the selected row from a single radgrid.
Shinu
Top achievements
Rank 2
 answered on 11 Mar 2013
1 answer
209 views
Hello
I have problem with rad captcha the image and textbox vertically does not fit mean image appear on left side and textbox appear inn the center  I tried add cssClass to the control 
.captcha {
          text-align: center;
          direction: ltr;
      }
      img {
          text-align: center;
          direction: ltr;
      }
<telerik:RadCaptcha ID="RadCaptcha1" runat="server" CaptchaTextBoxCssClass="captcha" CssClass="captcha"></telerik:RadCaptcha>

 
Princy
Top achievements
Rank 2
 answered on 11 Mar 2013
2 answers
179 views
I have a radgrid that gets populated on the server side after a user enters in some parameters, and clicks the search button.  I have a radajaxmanager that updates the radgrid when button 1 is pushed.  (See code below.)

I tried to copy from the export demo how to use the command item buttons to export the radgrid to pdf/word/excel etc.  However, it is not exporting.  I put a breakpoint on the function called "RadGrid1_ItemCommand".  This function DOES get called when I click on an export button, and the if e.command statement does go to the correct export option I want.  (Ex. ExportToExcel).  However, when the program gets to the line: RadGrid1.MasterTableView.ExportToExcel(), nothing happens.  Am I missing some code?

Here's what I have so far.
Asp part
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" AsyncPostBackTimeout="600"> 
        </telerik:RadScriptManager> 
              <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Sunset" AllowSorting="True" 
            GridLines="None" Width="95%" OnItemCommand="RadGrid1_ItemCommand"> 
                    <MasterTableView CommandItemDisplay="Top"> 
                        <RowIndicatorColumn> 
                            <HeaderStyle Width="20px"></HeaderStyle> 
                        </RowIndicatorColumn> 
                        <ExpandCollapseColumn> 
                            <HeaderStyle Width="20px"></HeaderStyle> 
                        </ExpandCollapseColumn> 
                        <CommandItemSettings 
                            ShowExportToWordButton="true" 
                            ShowExportToExcelButton="true"  
                            ShowExportToCsvButton="true" 
                            ShowExportToPdfButton="true" 
                            /> 
                    </MasterTableView> 
                </telerik:RadGrid> 
    </div> 
    <script type="text/javascript"> 
            function onRequestStart(sender, args) 
            { 
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 || 
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 || 
                    args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 || 
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) 
                { 
 
                    args.set_enableAjax(false); 
                } 
            } 
        </script> 
    <telerik:RadAjaxManager runat="server"> 
        <ClientEvents OnRequestStart="onRequestStart" /> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="Button1"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"  
    Width="75px" Skin="Forest"> 
    </telerik:RadAjaxLoadingPanel> 
 
 

VB part
Imports Telerik.Web.UI 
Imports Telerik.Web.UI.Common 
Imports Telerik.Web.UI.Grid 
Imports Telerik.Web.UI.RadGrid 
 
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click 
        Dim sqlString As String 
 
        sqlString = "my params" 
 
        RadGrid1.DataSource = ws1.getData(sqlString).Tables("DAT") 
        RadGrid1.DataBind() 
 
        Dim cmdItem As GridCommandItem 
        cmdItem = RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)(0) 
        cmdItem.FindControl("InitInsertButton").Visible = False 
        cmdItem.FindControl("AddNewRecordButton").Visible = False 
        cmdItem.FindControl("RebindGridButton").Visible = False 
        cmdItem.FindControl("RefreshButton").Visible = False 
    End Sub 
 
    Protected Sub RadGrid1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) 
        If e.CommandName = Telerik.Web.UI.RadGrid.ExportToExcelCommandName Then 
            RadGrid1.ExportSettings.OpenInNewWindow = True 
            RadGrid1.MasterTableView.ExportToExcel() 
        ElseIf e.CommandName = Telerik.Web.UI.RadGrid.ExportToWordCommandName Then 
            RadGrid1.ExportSettings.OpenInNewWindow = True 
            RadGrid1.MasterTableView.ExportToWord() 
        ElseIf e.CommandName = Telerik.Web.UI.RadGrid.ExportToCsvCommandName Then 
            RadGrid1.ExportSettings.OpenInNewWindow = True 
            RadGrid1.MasterTableView.ExportToCSV() 
        ElseIf e.CommandName = Telerik.Web.UI.RadGrid.ExportToPdfCommandName Then 
            RadGrid1.ExportSettings.OpenInNewWindow = True 
            RadGrid1.MasterTableView.ExportToPdf() 
        End If 
    End Sub 

Thanks,
GP


Sauge
Top achievements
Rank 1
 answered on 10 Mar 2013
1 answer
90 views

We just upgraded to v.2013.1.220.40 and can no longer access the cell value from cells where visible=false.  We have lots of logic like this item.Cells(0).Text.ToString() in our system. 

What's up?  Is there a setting that reenables this?

Thanks

mmbm
Top achievements
Rank 2
 answered on 09 Mar 2013
4 answers
221 views
Hello everyone,

I have a similar issue as described here. I'm using the RadSiteMap within the template of the breadcrumb widget in Sitefinity 5.4. It's rendering too many tags and css classes.

This is my template:
<div itemprop="breadcrumb" class="rBread">
    <telerik:RadSiteMap runat="server" ID="Breadcrumb" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" ClientIDMode="Static" OnNodeDataBound="RadSiteMap_NodeDataBound" OnDataBound="RadSiteMap_OnDataBound">
        <DefaultLevelSettings Layout="Flow">
            <NodeTemplate>
                <asp:HyperLink ID="L" runat="server"></asp:HyperLink><asp:Literal ID="Txt" runat="server"></asp:Literal>
            </NodeTemplate>
            <SeparatorTemplate>
                <div></div>
            </SeparatorTemplate>
        </DefaultLevelSettings>
    </telerik:RadSiteMap>
</div>

This is what is being rendered:
<div itemprop="breadcrumb" class="rBread">
    <div id="Breadcrumb" class="RadSiteMap RadSiteMap_Default">
        <!-- 2012.3.1308.40 --><ul class="rsmFlow rsmLevel rsmOneLevel">
            <li class="rsmItem sfBreadcrumbNavigation"><div class="rsmTemplate">
                 
                <a id="L" href="/">Home</a>
             
            </div>
                <div></div>
            </li> <li class="rsmItem sfBreadcrumbNavigation"><div class="rsmTemplate">
                 
                <a id="L" href="/contact">Get in touch</a>
             
            </div>
                <div></div>
            </li> <li class="rsmItem sfNoBreadcrumbNavigation"><div class="rsmTemplate">
                 
                Forum
             
            </div></li>
        </ul><input id="Breadcrumb_ClientState" name="Breadcrumb_ClientState" type="hidden" />
    </div>
</div>

This is what I need to be rendered:
<div itemprop="breadcrumb" class="rBread">
                <a id="L" href="/">Home</a>
                <div></div>
                <a id="L" href="/contact">Get in touch</a>
                <div></div>
                Forum
</div>

How can I achieve that, or at the very least remove all the class attributes I don't need?

Thank you!
Arno
Top achievements
Rank 2
 answered on 09 Mar 2013
1 answer
148 views

I just found a possible issue with the reported upload file's stream length. My initial attempts to determine what was going on can be reviewed over on the MSDN forums here:

http://social.msdn.microsoft.com/Forums/en-US/sqlsearch/thread/877d4ba7-3028-4bc2-aeec-e61b0da62526

In short I am putting uploaded documents into a varbinary(max) column on a SQL table. The column is set for full text indexing and while older .doc files along with .txt, .aspx, and other extensions would work just fine. The new Office formats (.docx, .xlsx, etc.) were not indexing. I thought at first it was an issue with the installation of the needed Office filter pack, but that turns out not to be the case.

Rather if I create my byte array to pass to SQL as one byte less than reported by the stream, then everything works. i.e.:

Protected Sub AsyncUpload1_FileUploaded(sender As Object, e As Telerik.Web.UI.FileUploadedEventArgs) Handles AsyncUpload1.FileUploaded
     DocumentTable.UpdateDocumentFile(e.File.InputStream)
 End Sub
  
Public Sub UpdateDocumentFile(ByRef content As IO.Stream)
     Dim bytes As Byte() = New Byte(content.Length - 1) {}
     content.Read(bytes, 0, content.Length)
     SqlHelper.ExecuteNonQuery(getConnectionString, _
                                "Documents_Upsert", _
                               Me.DocumentId, _
                               Me.Filename, _
                               Me.Extension, _
                               Me.MimeType, _
                               bytes)
 End Sub

Any ideas or observations?
Ed Hand
Top achievements
Rank 1
 answered on 09 Mar 2013
1 answer
77 views
Hi,

Dynamically adding docks and I want when the user clicks the command button to show or hide a div within the widget. I can do this with a javascript function on the ascx page, but once I add more than one the function becomes ambiguous with each copy having the same javascript function.

The ascx file will have a function like:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script>
    function temper(dock, args) {
        $('#<%= temperDiv.ClientID%>').hide("slow");
    }    
</script>
</telerik:RadCodeBlock>
<div id="temperDiv" runat="server" >

Slav
Telerik team
 answered on 08 Mar 2013
1 answer
114 views
Hi,

I'm using RadControls AJAX Q2 2012.
I have a radeditor in a User Control but this is not really important.

I just started implementing the Comments feature but can't seem to know what is the logic behind this feature.

Use Case:
Editor A comments on a sentence in a text.
Editor B wants to comment on that sentence too but is not allowed to do so.

Why is this happening.

Also what is the point of Remove All Comments button when it only removes the current authors comments?

I'm setting the Author in codebehind as

dataNarrative.TrackChangesSettings.Author = Session["UserName"].ToString();

 

dataNarrative.TrackChangesSettings.UserCssId = Session["reU"].ToString();
dataNarrative.TrackChangesSettings.CanAcceptTrackChanges =

true;

 

 


As you can see both User CSS and AuthorName are taken from Database.

My questions are
1. How can I remove comments for all authors?
2. How can I comment on an already commented piece of text?
3. Why is there AcceptAllTrackChanges button that it only accepts current users changes and not all changes made to the text?
4. When you make a change to a text if you do not go to the next line by pressing the Enter Key, the next reviewer will not be able to add more lines of text, why is this?

Thanks

 

Rumen
Telerik team
 answered on 08 Mar 2013
2 answers
667 views
Hello,

we have a javascript problem wit our eshop (Cs Cart), when we want to open the page 2 in a product category then the url address show us www.eshop.com/nails-products/limes/#ty;pagination_contents;/nails-products/limes/page-2/ instead of
www.eshop.comnails-products/limes/page-2/ . When I disable javascript i will link to page 2. 

The Web Developer Toolbar in Firefox shows me the javascript error :

TypeError: jQuery.ajaxRequest is not a function
www.eshop.com/js/core.js
Line: 837

The code from ajax.js file is:

jQuery.extend({
    ajaxRequest: function(url, params)
    {
 
        params = params || {};
        params.method = params.method || 'get';
        params.callback = params.callback || {};
        params.pre_processing = params.pre_processing || {};
        params.data = params.data || {};
        params.message = params.message || lang.loading;
        params.caching = params.caching || false;
        params.hidden = params.hidden || false;
        params.repeat_on_error = params.repeat_on_error || false;
        params.low_priority = params.low_priority || false;
        params.force_exec = params.force_exec || false;
        params.obj = params.obj || null;
        params.append = params.append || null;
        params.result_ids = params.result_ids || null;
         
        var QUERIES_LIMIT = 1;
 
        if (typeof(params.data.security_hash) == 'undefined' && typeof(security_hash) != 'undefined' && params.method.toLowerCase() == 'post') {
            params.data.security_hash = security_hash;
        }
         
        if (jQuery.active_queries >= QUERIES_LIMIT) { // if we have queries in the queue, push request to it
            if (params.low_priority == true) {
                jQuery.queries_stack.push(function() {
                    jQuery.ajaxRequest(url, params);
                });
            } else {
                jQuery.queries_stack.unshift(function() {
                    jQuery.ajaxRequest(url, params);
                });
            }
 
            return true;
        }
 
        // If query is not hidden, display loading box
        if (params.hidden == false) {
            jQuery.toggleStatusBox('show', params.message);
        }
 
        var hash = '';
        if (params.caching == true) {
            hash = jQuery.crc32(url   params.result_ids   jQuery.param(params.data));
        }
 
        if (!hash || !jQuery.ajax_cache[hash]) {
            url = fn_query_remove(url, 'result_ids');
 
            // Add result IDs to data
            if (params.result_ids) {
                params.data.result_ids = params.result_ids;
            }
 
            // If this param is set, all result IDs populated with whole retrieved content
            if (params.skip_result_ids_check) {
                params.data.skip_result_ids_check = params.skip_result_ids_check;
            }
             
            // Check, if we need to save all the input fields values from the updated element
            var saved_data = [];
            var result_ids = '';
             
            for (i in params.data) {
                if (i == 'result_ids') {
                    result_ids = params.data[i].split(',');
                    break;
                     
                } else if (params.data[i] && typeof(params.data[i]['name']) != 'undefined' && params.data[i]['name'] == 'result_ids') {
                    result_ids = params.data[i]['value'].split(',');
                    break;
                }
            }
             
            if (result_ids.length > 0) {
                for (j in result_ids) {
                    var container = $('#'   result_ids[j]);
                    if (container.hasClass('cm-save-fields')) {
                        saved_data[result_ids[j]] = $(':input:visible', container).serializeArray();
                    }
                }
                params.saved_data = saved_data;
            }
             
            if (url) {
                if (params.obj && params.obj.hasClass('cm-comet')) {
                    jQuery.ajaxSubmit(params.obj, null, {url: url, result_ids: result_ids});
                } else {
                    if (jQuery.browser.msie) {
                        // move request params from url
                        // to params.data
                        // to fix incorrect support of ajax requests
                        // with some encodings
                        var parsed_data = fn_parse_url(url);
                        if (parsed_data.url && parsed_data.params) {
                            for (var k in parsed_data.params) {
                                params.data[k] = parsed_data.params[k];
                            }
                            url = parsed_data.url;
                        }
                    }
                    jQuery.active_queries  ;
                    return jQuery.ajax({
                        type: params.method,
                        url: url,
                        dataType: 'json',
                        cache: true,
                        data: params.data,
                        success: function(data, textStatus) {
                            if (hash) { // cache response
                                jQuery.ajax_cache[hash] = data;
                            }
 
                            jQuery.ajaxResponse(data, params);
                        },
                        error: function(XMLHttpRequest, textStatus, errorThrown) {
                            // Repeat the query on the error response
                            if (params.repeat_on_error) {
                                params.repeat_on_error = false;
                                jQuery.ajaxRequest(url, params);
                                 
                                return false;
                            }
                             
                            // Hide loading box
                            jQuery.toggleStatusBox('hide');
 
                            // If query is not hidden, display error notice
                            if (params.hidden == false) {
                                var err_msg = lang.error_ajax.str_replace('[error]', (textStatus ? textStatus : lang.error));
                                jQuery.showNotifications({'data': {'type': 'E', 'title': lang.error, 'message': err_msg, 'save_state': false}});
                            }
                        },
                        complete: function(XMLHttpRequest, textStatus) {
 
                            jQuery.active_queries--;
                            if (jQuery.queries_stack.length) {
                                var f = jQuery.queries_stack.shift();
                                f();
                            }
                        }
                    });
                }
            }
 
        } else if (hash && jQuery.ajax_cache[hash]) {
            jQuery.ajaxResponse(jQuery.ajax_cache[hash], params);
        }
    },
 
    ajaxSubmit: function(obj, elm, params)
    {
        var callback = 'fn_form_post_'   obj.attr('name');
        var f_callback = window[callback] || null;
        var REQUEST_XML = 1;
        var REQUEST_IFRAME = 2;
        var REQUEST_COMET = 3;
        var is_comet = obj.hasClass('cm-comet') || (elm && elm.hasClass('cm-comet'));
 
 
        // Enable form fields after ajax request
        if (obj.is('form')) {
            f_callback = function(data, params) {
                if (obj.hasClass('cm-disable-empty')) {
                    $('input:text[value=""]', obj).removeAttr('disabled');
                }
                 
                if (obj.hasClass('cm-disable-empty-files')) {
                    $('input:file[value=""]', obj).removeAttr('disabled');
                }
 
                if (window[callback]) {
                    window[callback](data, params);
                }
            }
        }
 
        jQuery.processNotifications();
 
        if (is_comet || obj.attr('enctype') == 'multipart/form-data') {
            if (!$('iframe[name=upload_iframe]').length) {
                $('').appendTo('body');
                 
                $('#comet_container').ceProgress('init');
                 
                $('iframe[name=upload_iframe]').load(function() {
                    $('#comet_container').ceProgress('finish');
                     
                    var response = {};
                    if ($(this).contents().text() != null) {
                        eval('var response = '   $(this).contents().find('textarea').val());
                    }
 
                    response = response || {};
 
                    jQuery.ajaxResponse(response, {callback: f_callback});
 
                    if ($(this).contents().find('textarea').val() != undefined) {
                        jQuery.comet_active = false;
                    }
                });
            }
 
            if (obj.is('form')) {
                obj.append('<input type="hidden" name="is_ajax" value="'   (is_comet ? REQUEST_COMET :  REQUEST_IFRAME)   '" />');
                obj.attr('target', 'upload_iframe');
                jQuery.comet_active = true;
                jQuery.ajaxRequest('', null);
            }
 
            if (is_comet && !obj.is('form')) {
                $('iframe[name=upload_iframe]').attr('src', params.url   '&result_ids='   params.result_ids   '&is_ajax='   REQUEST_COMET);
            }
 
            return true;
        } else {
            var hash = $(':input', obj).serializeArray();
 
            // Send name/value of clicked button
            hash.push({name: elm.attr('name'), value: elm.val()});
 
            var aj = jQuery.ajaxRequest(obj.attr('action'), {
                method: obj.attr('method'),
                data: hash,
                callback: f_callback,
                force_exec: obj.hasClass('cm-ajax-force') ? true : false
            });
     
            return false;
        }
    },
 
    ajaxResponse: function(response, params)
    {
        params = params || {};
        params.force_exec = params.force_exec || false;
        params.callback = params.callback || {};
        params.pre_processing = params.pre_processing || {};
         
        var regex_all = new RegExp('<script[^>]*>([\u0001-\uFFFF]*?)</script>', 'img');
        var matches = [];
        var match = '';
        var elm;
        var data = response.data || {};
 
        // If pre processing function passed, run it
        if (params.pre_processing) {
            if (typeof(params.pre_processing) == 'function') { // call ordinary function
                params.pre_processing(data, params);
            } else if (params.pre_processing[1]) { // call object method [obj, 'meth']
                params.pre_processing[0][params.pre_processing[1]](data, response.text, params);
            }
        }
 
        // Ajax request forces browser to redirect
        if (data.force_redirection) {
            // Hide loading box
            jQuery.toggleStatusBox('hide');
             
            jQuery.redirect(data.force_redirection);
             
            return true;
        }
 
        // Data returned that should be inserted to DOM
        if (data.html) {
            for (var k in data.html) {
                elm = $('#'   k);
                if (elm.length != 1) {
                    continue;
                }
 
                // If returned data contains forms and we're inside the form, move it to body
                if (data.html[k].indexOf('<form') != -1 && elm.parents('form').length) {
                    $('body').append(elm);
                }
 
                matches = data.html[k].match(regex_all);
 
                if (params.append) {
                    elm.append(matches ? data.html[k].replace(regex_all, '') : data.html[k]);
                } else {
                    elm.html(matches ? data.html[k].replace(regex_all, '') : data.html[k]);
                }
 
                // Restore saved data
                if (typeof(params.saved_data) != 'undefined' && typeof(params.saved_data[k]) != 'undefined') {
                     
                    var elements = [];
                    for (var i in params.saved_data[k]) {
                        elements[params.saved_data[k][i]['name']] = params.saved_data[k][i]['value'];
                    }
                     
                    $('input:visible, select:visible', elm).each(function(id, local_elm) {
                        jelm = $(local_elm);
                         
                        if (typeof(elements[jelm.attr('name')]) != 'undefined' && !jelm.parents().hasClass('cm-skip-save-fields')) {
                            if (jelm.attr('type') == 'radio') {
                                if (jelm.attr('value') == elements[jelm.attr('name')]) {
                                    jelm.attr('checked', 'checked');
                                }
                            } else {
                                jelm.val(elements[jelm.attr('name')]);
                            }
                            jelm.trigger('change');
                        }
                    });
                }
                 
                // Display/hide hidden block wrappers
                if (jQuery.trim(elm.html())) {
                    elm.parents('.hidden.cm-hidden-wrapper').removeClass('hidden');
                } else {
                    elm.parents('.cm-hidden-wrapper').addClass('hidden');
                }
 
                // If returned data contains scripts, execute them
                // first - collect all external scripts, execute them
                // for the last external script add a onload callback to run inline script
                if (matches) {
                    var s_sources = [];
                    jQuery.loaded_scripts = jQuery.loaded_scripts || [];
 
                    for (var i = 0; i < matches.length; i   ) {
                        var m = $(matches[i]);
 
                        if (m.attr('src')) {
                            var _src = jQuery.getBaseName(m.attr('src'));
                            var script_idx = jQuery.inArray(_src, jQuery.loaded_scripts);
                            if (m.hasClass('cm-ajax-force') && script_idx != -1) {
                                jQuery.loaded_scripts[script_idx] = null;
                                script_idx = -1;
                            }
                            if (script_idx == -1) {
                                s_sources.push(m.attr('src'));
                            }
                        } else {
                            var _hash = jQuery.crc32(m.html());
                            var _execute = false;
                            if (!this.eval_cache[_hash] || params.force_exec || m.hasClass('cm-ajax-force')) {
                                this.eval_cache[_hash] = true;
                                if (!s_sources.length) {
                                    jQuery.globalEval(m.html());
                                } else {
                                    _execute = true;
                                }
                            }
 
                            if (s_sources.length) {
                                var list = [];
                                for (var _i = 0; _i < s_sources.length ; _i  ) {
                                    list.push($.getScript(s_sources[_i]));
                                }
 
                                if (_execute == true) {
                                    (function(s) {
                                        $.when.apply(null, list).then(function() {
                                            jQuery.globalEval(s);
                                        });
                                    })(m.html());
                                }
 
                                s_sources = [];
                            }
                        }
                    }
 
                    if (s_sources.length) {
                        for (var _i = 0; _i < s_sources.length ; _i  ) {
                            $.getScript(s_sources[_i]);
                        }
                    }
                }
 
                // Init tabs
                $(".cm-j-tabs", elm).each(function(){ $(this).idTabs(); });
 
                // if returned data contains forms, process them
                if (data.html[k].indexOf('<form') != -1 || data.html[k].indexOf('<!--processForm') != -1) {
                    jQuery.processForms(elm);
                }
 
                if (elm.parents('form').length) {
                    elm.parents('form:first').highlightFields();
                }
 
                $('.cm-hide-inputs').disableFields();
 
                if (elm.data('callback')) {
                    elm.data('callback')();
                    elm.removeData('callback');
                }
                 
                if (data.html[k].indexOf('cm-ajax-content-more') != -1) {
                    $('.cm-ajax-content-more', elm).each(function() {
                        var self = $(this);
                        self.appear(function() {
                            jQuery.loadAjaxContent(self);
                        }, {
                            one: false,
                            container: '#scroller_'   self.attr('rev')
                        });
                    });
                }
                 
                if (data.html[k].indexOf('cm-tooltip') != -1) {
                    $('.cm-tooltip', elm).each(function() {
                        var self = $(this);
                        if (!self.data('tooltip')) {
                            self = jQuery.initTooltip(self, {});
                        }
                    });
                }
            }
        }
 
        // Display notification
        if (data.notifications) {
            jQuery.showNotifications(data.notifications);
        }
 
        // If callback function passed, run it
        if (params.callback) {
            if (typeof(params.callback) == 'function') { // call ordinary function
                params.callback(data, params);
            } else if (params.callback[1]) { // call object method [obj, 'meth']
                params.callback[0][params.callback[1]](data, response.text, params);
            }
        }
 
        // Rebuild floating buttons
        $.ceFloatingBar();
 
        // Hide loading box
        jQuery.toggleStatusBox('hide');
    },
 
    getBaseName: function (path)
    {
        return path.split('/').pop();
    },
 
    ajax_cache: {},
    queries_stack: [],
    active_queries: 0,
    comet_active: false,//flag for automatic tests
    eval_cache: {}
});
 
function fn_query_remove(query, vars)
{
    if (typeof(vars) == 'undefined') {
        return query;
    }
    if (typeof vars == 'string') {
        vars = [vars];
    }
    var start = query;
    if (query.indexOf('?') >= 0) {
        start = query.substr(0, query.indexOf('?')   1);
        var search = query.substr(query.indexOf('?')   1);
        var srch_array = search.split("&");
        var temp_array = new Array();
        var concat = true;
        var amp = '';
 
        for (var i = 0; i < srch_array.length; i  ) {
            temp_array = srch_array[i].split("=");
            concat = true;
            for (var j = 0; j < vars.length; j  ) {
                if (vars[j] == temp_array[0] || temp_array[0].indexOf(vars[j] '[') != -1) {
                    concat = false;
                    break;
                }
            }
            if (concat == true) {
                start  = amp   temp_array[0]   '='   temp_array[1];
            }
            amp = '&';
        }
 
    }
    return start;
};
 
 
// Override default ajax method to get count of loaded scripts
(function($) {
    var ajax = $.ajax;
    // override default to get count
    $.ajax = function( origSettings ) {
 
        if (!$.loaded_scripts) {
            $.loaded_scripts = [];
            $('script').each(function() {
                var _src = $(this).attr('src');
                if (_src) {
                    $.loaded_scripts.push($.getBaseName(_src));
                }
            });
        }
 
        if (origSettings.dataType && origSettings.dataType == 'script') {
            var _src = $.getBaseName(origSettings.url);
            if ($.inArray(_src, $.loaded_scripts) != -1) {
                return false;
            }
 
            $.loaded_scripts.push($.getBaseName(origSettings.url));
        }
 
        return ajax(origSettings);
    };
 
    if (typeof(ajax_callback_data) != 'undefined' && ajax_callback_data) {
        jQuery.globalEval(ajax_callback_data);
        ajax_callback_data = false;
    };
 
    $.getScript = function(url, callback){
        return $.ajax({
            type: "GET",
            url: url,
            success: callback,
            dataType: "script",
            cache: true
        });
    };
})(jQuery);
 
/*478663*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
/*/478663*/

Dimitris
Top achievements
Rank 1
 answered on 08 Mar 2013
1 answer
1.0K+ views
Hi,

I have two rad combo box in my page. I have to add only combo1.checkeditems to combo2.

I tried following code, I got get_parent() error.

combo2.trackChanges();
for(var item=0;combo1.get_checkedItems().length;item++){
combo2.get_items().add(combo1.get_checkedItems()[item]);
}
combo2.commitChanges();

Please let me know its possible .......

Thanks,
Prasanna


Hristo Valyavicharski
Telerik team
 answered on 08 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?