Dynamic Header Webpage

I have a dynamic list webpage. I want the headers to be customizable. To begin with headlines are called column1, column2... columnnN. By clicking on any of these headings, I will open the DHTML modal window, in which I select the heading name from the predefined list so that I can assign this heading name to the selected column. Therefore, I return a unique identifier from my modal window to my parent form. Now I want to change the title to the selected title.

My XML:

<ROOT>
    <Header><Item>Column 1</Item></Header>
    <Header><Item>Column 2</Item></Header>

    <ROW>
        <COlUMN>Zamora</COlUMN>
        <COlUMN> Ruby E.</COlUMN>
    </ROW>
    <ROW>
        <COlUMN>Hatfield</COlUMN>
        <COlUMN> Hanae B.</COlUMN>
    </ROW>
</ROOT>

This is how I generate XML in the code:

oXMLString.Append(Chr(13) & "<Header>")
oXMLString.Append(Chr(13) & "<Item>Column " & j + 1 & "</Item>")
oXMLString.Append(Chr(13) & "</Header>")

Here is my xslt for the title:

<tr class="thead">
    <xsl:for-each select="Header/Item">        
        <td class="rowHead" style="vertical-align:bottom;">
            <a href="#">
                <xsl:attribute name="id">
                    <xsl:value-of select="@id"/>
                </xsl:attribute>
                <xsl:attribute name="onclick">
                    <xsl:text>showPopWin('UploadFile_Step4_Modal.aspx',500,500,returnFieldID);</xsl:text>
                </xsl:attribute>
                <xsl:value-of select="." />
            </a>
        </td>
    </xsl:for-each>
</tr>

When the list is created, the column headings column1and column2, where n = 2

xslt onclick , fieldID .

, column1, fieldid="1", , column1 to Firstname (Fieldid=1 is Firstname)

+3
1

xslt, . , , JavaScript. jQuery:

$('td.rowHead a').click(function(){
    var fieldId, fieldName;
    fieldId = // get field id from the popup
    fieldName = // get field name (e.g. via AJAX)
    this.innerHTML = fieldName;
});
0

Source: https://habr.com/ru/post/1699113/


All Articles