দ্রুত এবং সহজ: একটি SharePoint ফরম একটি টেক্সট ক্ষেত্রের আড়াল jQuery ব্যবহার করুন

এটা আমার আরেকটি পোস্ট সিরিজে চালু কিভাবে ব্যবহার করতে নেভিগেশন jQuery SharePoint সঙ্গে.
আপনি jQuery সম্পর্কে আরও জানতে চান, আমি অত্যন্ত সুপারিশ: এক্সন মধ্যে jQuery বিয়ার Bibeault এবং Yehuda Katz দ্বারা.

আপডেট (already!): I did think of a better way to locate the <-TR> tag I want to hide and wrote about it here. You may still find this article interesting anyway so I’m leavnig it up.

I want to hide a text field, “Hide Me!” as shown:

image

The following jQuery does the trick for me:

<স্ক্রিপ্টের ধরন ="text/javascript">

  $(কাজ() {


    $('ইনপুট[শিরোনাম = আমার লুকান!]').পিতা বা মাতা().পিতা বা মাতা().পিতা বা মাতা().আড়াল();

  });

</লিপি>

The code is saying, “find me all input fields whose title = Hide Me!. তারপর, get its parent and then next parent and the *next* parent (phew!) and invoke the hide() method on that thing, whatever it happens to be.

I figured out that parent structure by viewing the HTML for the form that SharePoint created as shown:

<-TR>
    <TD nowrap="true" valign="top" প্রস্থ="190px" বর্গ="ms-formlabel">
        <H3 বর্গ="ms-standardheader">
            <nobr>Hide Me!</nobr>
        </H3>
    </TD>

    <TD valign="top" বর্গ="ms-formbody" প্রস্থ="400px">
        <!-- FieldName="Hide Me!"
                 FieldInternalName="Hide_x0020_Me_x0021_"
                 FieldType="SPFieldText"
        -->
        <বিঘত dir="none">
            <ইনপুট
                নাম="ctl00$m$g_bdb23c2c_fde7_495f_8676_69714a308d8e$ctl00$ctl04$ctl02$ctl00$ctl00$ctl04$ctl00$ctl00$TextField"
                টাইপ="text"
                MAXLENGTH="255"
                আইডি="ctl00_m_g_bdb23c2c_fde7_495f_8676_69714a308d8e_ctl00_ctl04_ctl02_ctl00_ctl00_ctl04_ctl00_ctl00_TextField"
                শিরোনাম="Hide Me!"
                বর্গ="ms-long" />
                <বিআর>
        </বিঘত>


    </TD>
</-TR>

This picture shows the same, but marked up with the parents:

image

The first parent (1) is a span tag. Span’s parent (2) is a TD tag and then finally we get to the real parent I want to hide (3) which is the TR tag itself.

This is a pretty terrible approach I think because it’s extremely dependent on the very specific structure of this form. When SharePoint 2010 comes out, this whole structure could change and break this approach. What I really want to do is craft a jQuery selector that is along the lines of “find me all the TR’s (and only TR tags) that have somewhere in their child elements an input field whose title = Hide Me!". I starting from the bottom and moving up. Assuming I figure this out, I’ll post an updated “quick and easy’ post.

</শেষ>

আমার ব্লগ এর জন্য সাবস্ক্রাইব করুন.

টুইটারে আমার অনুসরণ http://www.twitter.com/pagalvin

del.icio.us ট্যাগ: ,

Technorati বিভাগ: ,

এক বিষয়ে চিন্তা "দ্রুত এবং সহজ: একটি SharePoint ফরম একটি টেক্সট ক্ষেত্রের আড়াল jQuery ব্যবহার করুন

  1. Jaap Vossers

    কি বাবা অথবা মা TR খোঁজার জন্য এই পদ্ধতির সম্পর্কে? পূর্বপুরুষ নোড সংগ্রহ প্রথম নোড যে TR উপাদান, নিকটতম পিতা বা মাতা TR ফলে.

    .বাবা("TR:প্রথম ")

একটি উত্তর ত্যাগ Jaap Vossers উত্তর বাতিল করুন

আপনার ইমেইল ঠিকানা প্রচার করা হবে না. প্রয়োজনীয় ক্ষেত্রগুলি চিহ্নিত করা আছে *