Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

As you type implementation not working across tabs - RapidSpell Web ASP.NET - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
arkatiyar
#1 Posted : Wednesday, February 26, 2014 2:20:29 AM
Rank: Member

Groups: Registered

Joined: 2/26/2014
Posts: 9
I have <ul><li> elements structure as below:

<ul class="tabs js-tabs">
<li class="current"><a href="#tab-Diagnosis">Diagnosis</a></li>
<li><a href="#tab-Procedures">Procedure</a></li>
<li ><a href="#tab-Notes">Sample Notes</a></li>
<li><a href="#tab-Review">Review</a></li>

</ul>

<Div> sections have been created for every href ID.

Problem:
I have registered RapidSpell-AYT.js on the web page. It is working for the text boxes on the page except those inside the div elements associated with above tabs. Please let me know how to fix it.
harry
#2 Posted : Wednesday, February 26, 2014 4:00:46 AM
Rank: Member

Groups: Registered

Joined: 4/22/2006
Posts: 216
arkatiyar
#3 Posted : Wednesday, February 26, 2014 7:53:29 PM
Rank: Member

Groups: Registered

Joined: 2/26/2014
Posts: 9
I tried to add "rapidSpell.ayt_setupTextBoxes(true);" function on tabClick event in my javascript file but it did not work for me. TabClick function is executed on every tab click.

Code:


    function onTabClick(event) {
        event.preventDefault();
       

        // If hashtag enabled
        if ($.fn.updateTabs.enabledHash) {
            // Retrieve hash parts
            var element = $(this);
            var hash = $.trim(window.location.hash || '');
            if (hash.length > 1) {
                // Remove hash from other tabs of the group
                var hashParts = hash.substring(1).split('&');
                var dummyIndex;
                while ((dummyIndex = $.inArray('', hashParts)) > -1) {
                    hashParts.splice(dummyIndex, 1);
                }
                while ((dummyIndex = $.inArray('none', hashParts)) > -1) {
                    hashParts.splice(dummyIndex, 1);
                }
                element.parent().parent().find('a[href^="#"]').each(function (i) {
                    var index = $.inArray($(this).attr('href').substring(1), hashParts);
                    if (index > -1) {
                        hashParts.splice(index, 1);
                    }
                });
            }
            else {
                var hashParts = [];
            }

            // Add current tab to hash (not if default)
            var defaultTab = getDefaultTabIndex(element.parent().parent());
            if (element.parent().index() != defaultTab) {
                hashParts.push(element.attr('href').substring(1));
            }

            // If only one tab, add a empty id to prevent document from jumping to selected content
            if (hashParts.length == 1) {
                hashParts.unshift('');
            }

            // Put hash, will trigger refresh
            window.location.hash = (hashParts.length > 0) ? '#' + hashParts.join('&') : '#none';
        }
        else {
            var li = $(this).closest('li');
            li.addClass('current').siblings().removeClass('current');

            li.parent().updateTabs();
        }
        rapidSpell.ayt_setupTextBoxes(true);
       // rapidSpell.ayt_spellCheck(); -- also tried this but did not work
    };


arkatiyar
#4 Posted : Wednesday, February 26, 2014 8:33:00 PM
Rank: Member

Groups: Registered

Joined: 2/26/2014
Posts: 9
Just to add - I am using Client Side method ( By referencing RapidSpell-AYT.js) on the page.
harry
#5 Posted : Wednesday, February 26, 2014 9:07:55 PM
Rank: Member

Groups: Registered

Joined: 4/22/2006
Posts: 216
Thanks - does this code

Code:

// Put hash, will trigger refresh
            window.location.hash = (hashParts.length > 0) ? '#' + hashParts.join('&') : '#none';


get run, and does it (as it looks) reload the page?

Regards.

-Harry
-Harry
arkatiyar
#6 Posted : Wednesday, February 26, 2014 11:25:05 PM
Rank: Member

Groups: Registered

Joined: 2/26/2014
Posts: 9
Yes, it reloads the page to make keep that tab open by default.
harry
#7 Posted : Thursday, February 27, 2014 4:00:52 AM
Rank: Member

Groups: Registered

Joined: 4/22/2006
Posts: 216
Ok, so in that case calling rapidSpell.ayt_setupTextBoxes(true); after the window.location.hash call is not going to work, because the page is reloading when that line is called.

You will probably need to call it after the tabs are initialized (when the textboxes in the new tab are actually shown), when the page has reloaded.

If you need help with that, please prepare a simple page the I can run which reproduces it, and I can work on it for you. You can post the code here or email to me via support @ keyoti.com



-Harry
-Harry
arkatiyar
#8 Posted : Wednesday, March 5, 2014 5:53:26 PM
Rank: Member

Groups: Registered

Joined: 2/26/2014
Posts: 9
Thanks Harry ! It worked for me.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.