private void SortByList() { StringBuilder itemViewListSortByBdl = new StringBuilder(); itemViewListSortByBdl.Append("<span class=\"sfLocale\">Sort by:</span><select id=\"ddlSortItemDetailBy\" class=\"sfListmenu\">"); SortByOptions = SortByOptions.TrimEnd(','); if (SortByOptions != "") { foreach (string sortByOpt in SortByOptions.Split(',')) { string[] sortByOpt1 = sortByOpt.Split('#'); if (sortByOpt1[0] == SortByOptionDefault) { itemViewListSortByBdl.Append("<option selected=\"selected\" data-html-text=\"" + sortByOpt1[1] + "\" value=" + sortByOpt1[0] + ">" + sortByOpt1[1] + "</option>"); } else { itemViewListSortByBdl.Append("<option data-html-text=\"" + sortByOpt1[1] + "\" value=" + sortByOpt1[0] + ">" + sortByOpt1[1] + "</option>"); } } } itemViewListSortByBdl.Append("</select>"); ltrItemViewDetailSortBy.Text = itemViewListSortByBdl.ToString(); if (Request.QueryString["id"] == "special") { LoadAllSpecialItems(); } }
private void SortByList() { StringBuilder itemViewListSortByBdl = new StringBuilder(); itemViewListSortByBdl.Append("<h4 class=\"sfLocale\">Sort by:</h4><select id=\"ddlSortItemDetailBy\" class=\"sfListmenu\">"); SortByOptions = SortByOptions.TrimEnd(','); if (SortByOptions != "") { foreach (string sortByOpt in SortByOptions.Split(',')) { string[] sortByOpt1 = sortByOpt.Split('#'); if (sortByOpt1[0] == SortByOptionDefault) { itemViewListSortByBdl.Append("<option selected=\"selected\" data-html-text=\"" + sortByOpt1[1] + "\" value=" + sortByOpt1[0] + ">" + sortByOpt1[1] + "</option>"); } else { itemViewListSortByBdl.Append("<option data-html-text=\"" + sortByOpt1[1] + "\" value=" + sortByOpt1[0] + ">" + sortByOpt1[1] + "</option>"); } } } itemViewListSortByBdl.Append("</select>"); ltrItemViewDetailSortBy.Text = itemViewListSortByBdl.ToString(); if (Request.QueryString["id"].ToLower() == "best") { LoadAllBestSoldItems(); } if (Request.QueryString["id"].ToLower() == "special") { LoadAllSpecialItems(); } if (Request.QueryString["id"].ToLower() == "feature") { LoadAllFeature(); } if (Request.QueryString["id"].ToLower() == "recent") { LoadAllRecentlyViewedItems(); } if (Request.QueryString["id"].ToLower() == "new") { LoadAllLatestItems(); } if (Request.QueryString["id"].ToLower() == "giftCard") { LoadAllGiftCard(); } if (Request.QueryString["id"] == "heavy") { LoadAllHeavyDiscountItems(); } if (Request.QueryString["id"] == "seasonal") { LoadAllSeasonalItems(); } }
public void CreateSortViewOption() { StringBuilder strSortView = new StringBuilder(); StringBuilder strToExecute = new StringBuilder(); strSortView.Append("<div id=\"divItemViewOptions\" class=\"viewWrapper\">"); strSortView.Append("<div id=\"divViewAs\" class=\"view\">"); if (ItemDisplayMode.ToLower() == "dropdown") { strSortView.Append("<h4>"); strSortView.Append(getLocale("View as:")); strSortView.Append("</h4>"); strSortView.Append("<select id=\"ddlAdvanceSearchViewAs\" class=\"sfListmenu\" style=\"display: none\">"); //Add view as option here if (ViewAsOptions != string.Empty) { string[] strViewAS = ViewAsOptions.Split(','); foreach (string strViewOpt in strViewAS) { if (strViewOpt != string.Empty) { string[] viewAsOption1 = strViewOpt.Split('#'); if (viewAsOption1[1].Length > 0) { strSortView.Append("<option value="); strSortView.Append(viewAsOption1[0]); strSortView.Append(">"); strSortView.Append(viewAsOption1[1]); strSortView.Append("</option>"); } } } strToExecute.Append("$('#ddlViewAs').val("); strToExecute.Append(ViewAsOptionsDefault); strToExecute.Append(");"); strToExecute.Append("$('#ddlViewAs').show();"); strToExecute.Append("$('#divViewAs').show();"); } strSortView.Append("</select>"); } else { if (ViewAsOptions != string.Empty) { string[] strViewAs = ViewAsOptions.Split(','); foreach (string strViewOpt in strViewAs) { if (strViewOpt != string.Empty) { string[] viewAsOption1 = strViewOpt.Split('#'); strSortView.Append("<a class='cssClass"); strSortView.Append(viewAsOption1[1]); strSortView.Append(" i-"); strSortView.Append(viewAsOption1[1]); strSortView.Append("\" id=\"view_"); strSortView.Append(viewAsOption1[0]); strSortView.Append(" displayId="); strSortView.Append(viewAsOption1[0]); strSortView.Append(" title="); strSortView.Append(viewAsOption1[1]); strSortView.Append("></a>"); } } strToExecute.Append("$('#divViewAs').find('a').each(function (i){"); strToExecute.Append("if ($(this).attr('displayId') =="); strToExecute.Append(ViewAsOptionsDefault); strToExecute.Append("{ $(this).addClass('sfactive'); } }); $('#divViewAs').show();"); } } strSortView.Append("</div>"); strSortView.Append("<div id=\"divSortBy\" class=\"sort\">"); strSortView.Append("<h4>"); strSortView.Append(getLocale("Sort by:")); strSortView.Append("</h4>"); strSortView.Append("<select id=\"ddlAdvanceSearchSortBy\" class=\"sfListmenu\">"); if (SortByOptions != string.Empty) { string[] strShortBy = SortByOptions.Split(','); foreach (string strSortOpt in strShortBy) { if (strSortOpt != string.Empty) { string[] sortByOption1 = strSortOpt.Split('#'); strSortView.Append("<option data-html-text='"); strSortView.Append(sortByOption1[1]); strSortView.Append("' value="); strSortView.Append(sortByOption1[0]); strSortView.Append(">"); strSortView.Append(sortByOption1[1]); strSortView.Append("</option>"); } } } strToExecute.Append("$('#ddlSortBy').val("); strToExecute.Append(SortByOptionsDefault); strToExecute.Append(");"); strToExecute.Append("$('#divSortBy').show();"); string script = GetStringScript(strToExecute.ToString()); strSortView.Append("</select>"); strSortView.Append("</div>"); strSortView.Append("</div>"); strSortView.Append(script); ltrSortView.Text = strSortView.ToString(); }