I have been given a task to move certain data to datatable.

I have been given a task to move certain data to datatable.

YinkaYinka Posts: 19Questions: 8Answers: 0

The table definition is filtering but immediately I move in the data using a strconcatstream object, datable becomes inactive. Please find my code below table body:

                            <%
                            for c = 0 to record_total
                               ls.add "<tr>"
                            ThisBrandID = RecArr(0,c)
                            ThisBrand = RecArr(1,c)

                            Col2 = cdbl(RecArr(2,c)) 'now 28
                            Col3 = cdbl(RecArr(3,c)) 'now 365
                            Col4 = cdbl(RecArr(4,c)) 'last 28/365
                            Col5 = cdbl(RecArr(5,c)) 'last 90/365

                            Col6 = cdbl(RecArr(6,c)) 'AOV
                            Col7 = cdbl(RecArr(7,c)) 'AOM
                            Col8 = cdbl(RecArr(8,c)) 'GM

                            Col9 = cdbl(RecArr(9,c)) 'MAX CPA

                            Col10 = cdbl(RecArr(10,c)) 'Stock �
                            Col11 = cdbl(RecArr(11,c)) 'Stock Days
                            Col12 = cdbl(RecArr(12,c)) '28 day sales last
                            Col13 = cdbl(RecArr(13,c)) '28 day sales prev
                            Col14 = cdbl(RecArr(14,c)) '28 day sales last year
                            Col15 = cdbl(RecArr(15,c)) '28 day growth on prev
                            Col16 = cdbl(RecArr(16,c)) '28 day growth on last year
                            Col17 = cdbl(RecArr(17,c)) '365 day trend, last
                            Col18 = cdbl(RecArr(18,c)) '365 day trend, last year
                            Col19 = cdbl(RecArr(19,c)) '365 day trend, growth

                            Col20 = cdbl(RecArr(20,c)) 'max orders per sku
                            Col21 = cdbl(RecArr(21,c)) 'value on order
                            Col22 = RecArr(22,c) 'next del date
                            Col23 = cdbl(RecArr(23,c)) 'days away
                            if col23 > 1000 then col23 = 999
                            Col24 = cdbl(RecArr(24,c)) 'any conf
                            Col25 = cdbl(RecArr(25,c)) 'brand
                            Col26 = cdbl(RecArr(26,c)) 'sales Oppo

                            Col27 = cdbl(RecArr(27,c)) '28 margin
                            Col28 = cdbl(RecArr(28,c)) 'nextorder

                            Col29 = cdbl(RecArr(29,c)) 'forward 7 %age
                            Col30 = cdbl(RecArr(30,c)) 'forward 7 value
                            Col31 = RecArr(31,c) 'next PO BI

                            monm = RecArr(32,c) 
                            monlm = RecArr(33,c) 
                            monpm = RecArr(34,c)

                            catroot = RecArr(35,c)
                            cattail = RecArr(36,c)

                            ShowThis = true

                            InstockPC_STYLE = ""
                            if InstockPC >= 95 then
                                InstockPC_STYLE = "color:green;font-weight:bold;"
                            elseif InstockPC >= 80 then
                                InstockPC_STYLE = "color:orange;font-weight:bold;"
                            elseif InstockPC < 80 then
                                InstockPC_STYLE = "color:red;font-weight:bold;"
                            end if                      

                                ShowCount = ShowCount + 1



                                HeadCounter = HeadCounter+1
                                if HeadCounter = HeadInterval then
                                    HeadCounter = 0
                                end if          

                                CMMTotal = CMMTotal + CMMVal



                                if SelPF = ThisPF then bg = "yellow"

                            if not PFDetailsShown then bg = swapbg()

                            ls.add "<tr onclick=""setHighlight('" & ThisBrandID & "', '" & bg & "');"" id=""PF_" & 
                                                              ThisBrandID & """ style=""background:" & bg & """>"




                            ls.add "<td valign=top style=font-size:8pt;><nobr>"
                            'ls.add "<a target=""_BLANK""  href=""/web_utils/ppgf_utils/stock_audit.asp? 
                                                                showSKU=" & ThisSKU & """>"
                            'ls.add "<img border=0 src=""/web_utils/images/magnifier.png"">"                    
                            ls.add catroot
                            ls.add "<a href=""?SortField=11"&tailstrsort&"&filterby='"&catroot&":'"">"
                            ls.add "<img border=0 title=""Filter to these depts"" 
                                                                       src=""/web_utils/images/folder_go.png"">"    
                            ls.add "</a><br>"
                            ls.add cattail
                            ls.add "<a href=/web_utils/ppgf_utils/item_sales_dept.asp? 
                                                               sortfield=1&deptidx="&ThisBrandID&">"
                            ls.add "<img border=0 title=""See Product Detail"" 
                                                                        src=""/web_utils/images/cog.png"">" 
                            ls.add "</a>"
                            ls.add "</td>"
                            ls.add "<td align=middle valign=top>"
                            ls.add "<a target=""_BLANK"" 
                                                                      href=""/web_utils/ppgf_utils/po/in_stock_forecast.asp? 
                                                                   SubmitButton=LINK&seldept="
                            ls.add ThisBrandID
                            ls.add """><img title=""View OOS detail report for this department"" 
                                                                    style=""border:0;"" src=""/web_utils/images/box.png""></a>"
                            ls.add "</td>"                      

                            ls.add "<td align=right style=""font-size:8pt;"" valign=top>"
                            ls.add formatnumber(Col12,0)
                            ls.add "</td>"          

                            ThisStyle = heatmapup(GrowthLow,GrowthHigh,Col15)
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            ls.add formatpercent(Col15,0)
                            ls.add "</td>"  

                            ThisStyle = ""
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            ls.add formatvalue(monm,0)
                            ls.add "</td>"  


                            ThisStyle = heatmapup(GrowthLow,GrowthHigh,Col16)
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"                  
                            ls.add formatpercent(Col16,0)
                            ls.add "</td>"          

                            ThisStyle = ""
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            ls.add formatvalue(monlm,0)
                            ls.add "</td>"  

                            ls.add "<td align=right style=""font-size:8pt;"" valign=top>"
                            ls.add formatnumber(Col17,0)
                            ls.add "</td>"          

                            ThisStyle = heatmapup(GrowthLow,GrowthHigh,Col19)
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"                  
                            ls.add formatpercent(Col19,0)
                            ls.add "</td>"

                            ThisStyle = ""
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            ls.add formatvalue(monpm,0)
                            ls.add "</td>"
                            ThisStyle = heatmapup(AvailLow, AvailHigh,Col2)
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            ls.add formatpercent(Col2,0)
                            ls.add "</td>"
                            ThisStyle = heatmapup(AvailLow, AvailHigh,Col3)
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            ls.add formatpercent(Col3,0)
                            ls.add "</td>"
                            ls.add "<td align=right style=""font-size:8pt;"" valign=top>"
                            ls.add formatnumber(Col26,0)
                            ls.add "</td>"  
                            ThisStyle = heatmapup(AvailLow, AvailHigh,Col4)
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            ls.add formatpercent(Col4,0)
                            ls.add "</td>"      
                            ThisStyle = heatmapup(AvailLow, AvailHigh,Col5)
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            ls.add formatpercent(Col5,0)
                            ls.add "</td>"      

                            ThisStyle = heatmapup(AvailLow, AvailHigh,Col29)
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            ls.add "<a target=""_BLANK""  href=""/web_utils/ppgf_utils/po/in_stock_forecast.asp?Submitbutton=LINK&SearchVal=" & ThisBrand & """>"
                            ls.add "<img border=0 src=""/web_utils/images/magnifier.png"">"
                            ls.add "</a> "
                            ls.add formatpercent(Col29,0)                   
                            ls.add "</td>"                  
                            ls.add "<td align=right style=""font-size:8pt;"" valign=top>"

                            ls.add formatnumber(Col30,0)
                            ls.add "</td>"

                            'ThisStyle = getColor(Col7)
                            'ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"
                            'ls.add formatpercent(Col7,0)
                            'ls.add "</td>"     
                            ls.add "<td align=right style=""font-size:8pt;"" valign=top>"
                            ls.add formatnumber(Col10,0)
                            ls.add "</td>"          
                            ls.add "<td align=right style=""font-size:8pt;"" valign=top>"
                            ls.add formatnumber(Col11,0)
                            ls.add "</td>"  




                            ls.add "<td align=right style=""font-size:8pt;"" valign=top>"
                            ls.add formatnumber(Col6,2)
                            ls.add "</td>"                      
                            ls.add "<td align=right style=""font-size:8pt;"" valign=top>"
                            ls.add formatnumber(Col7,2)
                            ls.add "</td>"  


                            ThisStyle = heatmapup(MarginLow,MarginHigh,Col8)
                            ls.add "<td align=right style=""font-size:8pt;" & ThisStyle & """ valign=top>"                  

                            ls.add formatpercent(Col8,0)
                            ls.add "<a target=""_BLANK""  href=""/web_utils/ppgf_utils/pfid_margin.asp?nameX=" &  ThisBrand& """>"
                            ls.add "<img border=0 src=""/web_utils/images/magnifier.png""></a>"
                            ls.add "</td>"                                  

                            ls.add "<td align=right style=""xfont-size:8pt;font-weight:bold;"" valign=top>"
                            ls.add formatnumber(Col9,2)
                            ls.add "</td>"                          




                            ls.add "</tr>"




                            next    

                                os= ls.value%>
                            <tbody id="promo">


                                                                  <%=os%>      






                            </tbody>

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @Yinka ,

    Is this a DataTable issue? I can't see where you're initialising the table.

    Cheers,

    Colin

  • YinkaYinka Posts: 19Questions: 8Answers: 0

    Hi @ Colin, its a datable issue. Before I put the above content, the table filters. If I write the string object value above to tbody tag the filtering disappears and just the just return table. Please what do you mean by where I initialise the table please found below the content of thead tag

    <thead id="promo1">
    <tr >
    <th rowspan=3 colspan=2 valign=bottom>Category</th>
    <th colspan=8 align=center valign=top>Sales Trends</th>
    <th colspan=7 align=center valign=top>Sales value weighted stock availability</th>
    <th colspan=2 rowspan =2 align=center valign=top>Stock</th>
    <th colspan=4 align=center valign=top>PPC Figures</th>

                                    </tr>
    
                                    <tr >
                                        <th colspan=1 align=center valign=top>28 Day</th>
                                        <th colspan=2 align=center valign=top>On Last 28</th>
                                        <th colspan=2 align=center valign=top>On L Yr</th>
                                        <th colspan=3 align=center valign=top>365 Day Trend</th>
                                        <th colspan=3 align=center valign=top>Now</th>
                                        <th colspan=2 align=center valign=top>of 365 Days</th>
                                        <th colspan=2 align=center valign=top width=60>Projected next PO BI</th>
                                        <th colspan=3 align=center valign=top>Last 28 Days</th>"
                                        <th rowspan=2 align=center valign=bottom>Max CPA</th>"
    
                                    </tr>
                                    <tr style=""background:#333;color:white;"">"
    
                                        <th  valign=top>Last</a></th>"  
    
                                        <th align=right valign=top width=20px>%age</th> 
    
    
                                        <th  valign=top align=center>�</th> 
    
    
                                        <th align=right valign=top width=20px align=center>%age</th>
    
    
                                        <th  valign=top align=center>�</th> 
    
    
                                        <th valign=top>Last</th>    
    
                                        <th align=right valign=top align=center>%age</th>   
    
                                        <th  valign=top align=center>�</th> 
    
    
                                        <th align=right valign=top>of 28</th>
    
    
                                        <th  valign=top  width=20px>of 365</th> 
    
                                        <th valign=top  width=20px>28 Opp</th>                                                      
                                        <th align=right valign=top>last 28</th>
                                        <th align=right valign=top>last 90</th>
    
                                        <th align=right valign=top>of 365</th>
    
                                        <th align=right valign=top>28 Opp</th>
    
                                        <th align=right valign=top>�</th>
                                        <th align=right valign=top>Days</th>    
    
    
                                        <th>AOV</a></th>"   
                                        <th align=right valign=top>AOM</th> 
                                        <th align=right valign=top>GM</th>
    
    
    
    
    
                                    </tr>
    
    
                                </thead>
    
  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    DataTables needs to be initialised within JS code - I'm not seeing any JS code. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • YinkaYinka Posts: 19Questions: 8Answers: 0

    @Colin, I have found a way around the task. Thank you as always. Please, how can I close this request or there is no need to?

This discussion has been closed.