How to hide the first two div using css? - html

Here is my page content
<div class="entry-content">
<div class="gv-grid">
<div class="gv-grid-col-1-1 gv-left">
<form class="gv-widget-search gv-search-vertical" method="get" action="https://www.mypage.com/test/">
<div class="gv-search-box">
<div class="gv-search">
<label for="gv_search_11">Tìm kiếm</label>
<p><input name="gv_search" id="gv_search_11" value="" type="text"></p>
</div>
</div> <div class="gv-search-box gv-search-box-submit">
<input name="mode" value="all" type="hidden">
<input class="button gv-search-button" id="gv_search_button_11" value="Search" type="submit">
</div>
</form>
</div>
<div class="gv-grid-col-1-2 gv-left">
</div>
<div class="gv-grid-col-1-2 gv-right">
</div>
</div>
<div class="gv-table-container gv-container">
<table class="gv-table-view">
<thead>
<tr>
<th id="gv-field-1-2" class="gv-field-1-2" style=""><span class="gv-field-label"> Cần mua hộ</span></th>
<th id="gv-field-1-6" class="gv-field-1-6" style=""><span class="gv-field-label"> Tiền công</span></th>
<th id="gv-field-1-15" class="gv-field-1-15" style=""><span class="gv-field-label"> Nơi mua</span></th>
<th id="gv-field-1-5" class="gv-field-1-5" style=""><span class="gv-field-label"> Nơi giao</span></th>
<th id="gv-field-1-4" class="gv-field-1-4" style=""><span class="gv-field-label"> Giao đồ trước</span></th>
<th id="gv-field-1-entry_link" class="gv-field-1-entry_link" style=""><span class="gv-field-label">Link</span></th>
</tr>
</thead>
<tbody>
<tr class="alt">
<td id="gv-field-1-2" class="gv-field-1-2">CEZANNE Lasting Lip Color N 402</td>
<td id="gv-field-1-6" class="gv-field-1-6">80 000</td>
<td id="gv-field-1-15" class="gv-field-1-15">Nhật Bản</td>
<td id="gv-field-1-5" class="gv-field-1-5">Hà Nội</td>
<td id="gv-field-1-4" class="gv-field-1-4">14/04/2016</td>
<td id="gv-field-1-entry_link" class="gv-field-1-entry_link">Chi tiết</td>
</tr>
</tbody>
<tfoot>
<tr>
<th id="gv-field-1-2" class="gv-field-1-2"><span class="gv-field-label"> Cần mua hộ</span></th>
<th id="gv-field-1-6" class="gv-field-1-6"><span class="gv-field-label"> Tiền công</span></th>
<th id="gv-field-1-15" class="gv-field-1-15"><span class="gv-field-label"> Nơi mua</span></th>
<th id="gv-field-1-5" class="gv-field-1-5"><span class="gv-field-label"> Nơi giao</span></th>
<th id="gv-field-1-4" class="gv-field-1-4"><span class="gv-field-label"> Giao đồ trước</span></th>
<th id="gv-field-1-entry_link" class="gv-field-1-entry_link"><span class="gv-field-label">Link</span></th>
</tr>
</tfoot>
</table>
</div><!-- end .gv-table-container -->
<div class="gv-grid">
<div class="gv-grid-col-1-1 gv-left">
</div>
<div class="gv-grid-col-1-2 gv-left">
</div>
<div class="gv-grid-col-1-2 gv-right">
</div>
</div>
<input class="gravityview-view-id" value="11" type="hidden">
<div class="gv-grid">
<div class="gv-grid-col-1-1 gv-left">
<form class="gv-widget-search gv-search-vertical" method="get" action="https://www.mypage.com/test/">
<div class="gv-search-box">
<div class="gv-search">
<label for="gv_search_7770">Tìm kiếm</label>
<p><input name="gv_search" id="gv_search_7770" value="" type="text"></p>
</div>
</div> <div class="gv-search-box gv-search-box-submit">
<input name="mode" value="all" type="hidden">
<input class="button gv-search-button" id="gv_search_button_7770" value="Search" type="submit">
</div>
</form>
</div>
<div class="gv-grid-col-1-2 gv-left">
</div>
<div class="gv-grid-col-1-2 gv-right">
</div>
</div>
<div class="gv-list-container gv-container">
<div id="gv_list_30" class="gv-list-view">
<div class="gv-list-view-title">
<h3 id="gv-field-1-custom" class="gv-field-1-custom"><b>Ga Cong Nghiep</b> cần mua <b>Giày zara kid size 37</b> bán tại <b>Tây Ban Nha</b></h3>
</div>
<div class="gv-grid gv-list-view-content">
<div class="gv-grid-col-1-3 gv-list-view-content-image"><div id="gv-field-1-14" class="gv-image gv-field-1-14"><a rel="gv-field-1-14-30" class="thickbox" target="_blank" href="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/1050103050_2_3_1.jpg"><img scale="0" src="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/1050103050_2_3_1.jpg" alt="Ảnh" class="gv-image gv-field-id-14" width="250"></a></div></div><div class="gv-grid-col-2-3 gv-list-view-content-description">
<div id="gv-field-1-custom" class="gv-field-1-custom">
<h4><span class="gv-field-label"></span></h4><p>
Nơi giao hàng: Lạng Sơn<br>
Tiền hàng: 25.95 EUR<br>
Tiền công : 150,000 VND<br>
(Có thể mặc cả tiền công)
</p>
<p>
<button>Chi tiết</button>
</p>
</div>
</div>
</div>
</div>
<div id="gv_list_23" class="gv-list-view">
<div class="gv-list-view-title">
<h3 id="gv-field-1-custom" class="gv-field-1-custom"><b>Nguyễn Yên</b> cần mua <b>3 hộp kem đánh răng</b> bán tại <b>Nhật Bản</b></h3>
</div>
<div class="gv-grid gv-list-view-content">
<div class="gv-grid-col-1-3 gv-list-view-content-image"><div id="gv-field-1-14" class="gv-image gv-field-1-14"><a rel="gv-field-1-14-23" class="thickbox" target="_blank" href="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/kem-danh-rang.jpg"><img scale="0" src="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/kem-danh-rang.jpg" alt="Ảnh" class="gv-image gv-field-id-14" width="250"></a></div></div><div class="gv-grid-col-2-3 gv-list-view-content-description">
<div id="gv-field-1-custom" class="gv-field-1-custom">
<h4><span class="gv-field-label"></span></h4><p>
Nơi giao hàng: Hà Nội<br>
Tiền hàng: 513 JPY<br>
Tiền công : 85,000 VND<br>
(Có thể mặc cả tiền công)
</p>
<p>
<button>Chi tiết</button>
</p>
</div>
</div>
</div>
</div>
<div id="gv_list_25" class="gv-list-view">
<div class="gv-list-view-title">
<h3 id="gv-field-1-custom" class="gv-field-1-custom"><b>Trường Hải Minh</b> cần mua <b>Đồng hồ Casio WAVECEPTOR WVQ-M410DE-2A2JF</b> bán tại <b>Nhật Bản</b></h3>
</div>
<div class="gv-grid gv-list-view-content">
<div class="gv-grid-col-1-3 gv-list-view-content-image"><div id="gv-field-1-14" class="gv-image gv-field-1-14"><ul class="gv-field-file-uploads gv-field-1-14"><li><a rel="gv-field-1-14-25" class="thickbox" target="_blank" href="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/51Pj4cBrBpL.jpg"><img scale="0" src="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/51Pj4cBrBpL.jpg" alt="Ảnh" class="gv-image gv-field-id-14" width="250"></a></li><li><a rel="gv-field-1-14-25" class="thickbox" target="_blank" href="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/81xcVWtGDyL._UL1500.jpg"><img scale="0" src="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/81xcVWtGDyL._UL1500.jpg" alt="Ảnh" class="gv-image gv-field-id-14" width="250"></a></li></ul></div></div><div class="gv-grid-col-2-3 gv-list-view-content-description">
<div id="gv-field-1-custom" class="gv-field-1-custom">
<h4><span class="gv-field-label"></span></h4><p>
Nơi giao hàng: Hà Nội<br>
Tiền hàng: 15,370 JPY<br>
Tiền công : 200,000 VND<br>
(Có thể mặc cả tiền công)
</p>
<p>
<button>Chi tiết</button>
</p>
</div>
</div>
</div>
</div>
<div id="gv_list_21" class="gv-list-view">
<div class="gv-list-view-title">
<h3 id="gv-field-1-custom" class="gv-field-1-custom"><b>Nguyễn Hương</b> cần mua <b>CEZANNE Lasting Lip Color N 402</b> bán tại <b>Nhật Bản</b></h3>
</div>
<div class="gv-grid gv-list-view-content">
<div class="gv-grid-col-1-3 gv-list-view-content-image"><div id="gv-field-1-14" class="gv-image gv-field-1-14"><a rel="gv-field-1-14-21" class="thickbox" target="_blank" href="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/N402.jpg"><img scale="0" src="https://www.mypage.com/wp-content/uploads/gravity_forms/1-f9c2348184f1140e486c01fab8f03460/2016/03/N402.jpg" alt="Ảnh" class="gv-image gv-field-id-14" width="250"></a></div></div><div class="gv-grid-col-2-3 gv-list-view-content-description">
<div id="gv-field-1-custom" class="gv-field-1-custom">
<h4><span class="gv-field-label"></span></h4><p>
Nơi giao hàng: Hà Nội<br>
Tiền hàng: 518 JPY<br>
Tiền công : 80,000 VND<br>
(Có thể mặc cả tiền công)
</p>
<p>
<button>Chi tiết</button>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="gv-grid">
<div class="gv-grid-col-1-1 gv-left">
</div>
<div class="gv-grid-col-1-2 gv-left">
</div>
<div class="gv-grid-col-1-2 gv-right">
</div>
</div>
<input class="gravityview-view-id" value="7770" type="hidden">
I want to use css to hide the first two div of .entry-content.
How can I do it?

You can do following way using :first-child css:
.entry-content div:first-child, .entry-content div:first-child + div {
display:none;
}
<div class="entry-content">
<div class="gv-grid">1</div>
<div class="gv-table-container gv-container">2</div>
<div class="gv-grid">3</div>
<div class="gv-table-container gv-container">4</div>
</div>
Edit:
As per you html structure use css like following:
.entry-content > div:first-child, .entry-content > div:first-child + div {
display:none;
}

Try using the nth-child selector:
.entry-content div:nth-child(-n+2){
display:none;
}
<div class="entry-content">
<div class="gv-grid">1st</div>
<div class="gv-table-container gv-container">2nd</div>
<div class="gv-grid">3rd</div>
<div class="gv-table-container gv-container">4th</div>
</div>

<div class="entry-content">
<div class="gv-grid" style="display: none;">...</div> //HIDE THIS
<div class=gv-table-container gv-container" style="display: none;">...</div> //HIDE THIS
<div class="gv-grid">...</div>
<div class=gv-table-container gv-container">...</div>
</div>
style tag is embedded CSS.

Simple CSS2.1 version of this uses the sibling selector.
.gv-grid, .gv-table-container {
display: none;
}
.gv-grid ~ .gv-grid, .gv-table-container ~ .gv-table-container {
display: block;
}
The way the sibling selector works is that is will fire if an element has an earlier sibling that matches.
So the first rule applies to all .gv-grid and .gv-table-container elements within a shared parent; the subsequent rule will override it for later .gv-grid and .gv-table-container elements.

Related

How to make search bar that search in different column

I trying to make search bar that search in different column I have an property table where I want to search the data with different things like I want to search data with price range an also I want to search data with area range. I make this in asp.net core mvc. I want to make search look like that https://www.zameen.com/
My View:
#model IEnumerable<eHouse.Models.RentModel>
<form>
<div class="wrap">
<div class="search">
<input type="text" class="searchTerm" style="width: 700px; color:#000000; text-align: left;" placeholder="Search Houses" onclick="filterfunction()">
<button type="submit" class="searchButton" >
<i class="fa fa-search"></i>
</button>
</div>
<div id="filter">
<select>
<option value="Kanal">Kanal</option>
<option value="Marla">Marla</option>
<option value="Square Feet">Square Feet</option>
<option value="Square Meter">Square Meter</option>
<option value="Square Yards">Square Yards</option>
</select>
<input type="text" placeholder="area" />
<input type="text" placeholder="price" />
</div>
</div>
</form>
Kindly also tell me that how can I bind data with this to display in this div.
<div class="property_information" >
#foreach (var item in Model)
{
<div class="home-info">
<span id="houseid">
</span>
<a href="#" class="home-images">
<img src="#item.pic1" />
</a>
<div class="home-data">
<div class="home-name">
<p>#item.tittle</p>
</div>
<div class="price">
<p>#item.price</p>
</div>
<div class="features">
<span>
#item.bedroom
</span>
<span>
#item.bathroom
</span>
<span>
2
</span>
</div>
<div class="desc">
#item.descrip
</div>
<div class="contact-save">
<a href="#" class="phone_number" id="favorite" onclick="Fav(this)" data-id="#item.id" >
<i class="fas fa-heart" style=" color: white;"></i>
</a>
<div class="popup" onclick="myFunction()">
<a href="tel:+928754756478" class="phone_number" onclick="call()">
</a>
</div>
<div class="popupmsg" onclick="myFunctionmsg()">
<a href="#" class="phone_number open_message" onclick="msg()">
</a>
</div>
<a href="#" class="phone_number" onclick="del(this)" data-id="#item.id">
<i class="fas fa-trash-alt" style=" color: white;"></i>
</a>
</div>
</div>
</div>
}
</div>
My Controller:
public IActionResult Rent(int PageNumber = 1)
{
var data = rdb.GetDataHouse();
var datas = rdb.GetDataHouse();
ViewBag.Data = datas.ToList().Take(6);
ViewBag.Totalpages = Math.Ceiling(data.Count()/6.0);
data = data.Skip((PageNumber - 1) * 6).Take(6).ToList();
return View(data);
}
try using tables and import jquery data tables library
<table id="table">
<thead>
<tr>
<th>col 1</th>
<th>col 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>data 1</td>
<td>data 2</td>
</tr>
</tbody>
</table>
<script>
$('#table').DataTable({
processing: true,
serverSide: true,
...rest
})
</script>

Bigcommerce Edit PayPal Button & Extend Link Area

We are using PayPal Express to quick checkout on the cart level. We would like to add "another" button that says PayPal Credit but has the same target with the original PayPal Express button. Extending clickable area of the first button would resolve the issue. Or could it be possible to make the 2nd button have the same target?
<script type="text/javascript">
lang.InvalidQuantity = "%%LNG_InvalidQuantity%%";
lang.Calculating = "%%LNG_Calculating%%"
lang.CalculateShipping = "%%LNG_CalculateShipping%%"
lang.ChooseShippingMethod = "%%LNG_ChooseShippingMethod%%"
lang.CartRemoveConfirm = '%%LNG_CartRemoveConfirm%%';
lang.ConfirmRemoveGiftWrapping = '%%LNG_ConfirmRemoveGiftWrapping%%';
lang.SelectCountry = '%%LNG_ChooseShippingCountry%%';
lang.SelectState = '%%LNG_ChooseShippingState%%';
lang.EnterZip = '%%LNG_EnterShippingZip%%';
</script>
<script src="%%GLOBAL_CdnAppPath%%/javascript/jquery/plugins/imodal/imodal.js?%%GLOBAL_JSCacheToken%%" type="text/javascript"></script>
<div class="Block Moveable Panel" id="CartContent_modified">
<div class="BlockContent">
<div style="display: %%GLOBAL_HideShoppingCartGrid%%" id="CartFormContainer">
<form enctype="multipart/form-data" onsubmit="return Cart.ValidateQuantityForm(this);" action="/cart.php" name="cartForm" id="cartForm" method="post">
<input type="hidden" name="action" value="update" />
<table class="CartContents Stylize General" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th class="HL-CartItems" colspan="2">%%LNG_CartItems%%</th>
<th class="HL-Qty">%%LNG_Qty%%</th>
<th class="HL-Remove"> </th>
<th class="HL-ItemPrice">%%LNG_ItemPrice%%</th>
<th class="HL-Total">%%LNG_HC_total%%</th>
</tr>
</thead>
<tfoot>
<tr class="SubTotal">
<td colspan="6"><div>%%LNG_Subtotal%% <em class="ProductPrice">%%GLOBAL_CartItemTotal%%</em></div></td>
</tr>
<tr class="SubTotal" style="%%GLOBAL_HideGiftWrappingTotal%%">
<td colspan="6"><div>%%LNG_GiftWrapping%% <em class="ProductPrice">%%GLOBAL_GiftWrappingTotal%%</em></div></td>
</tr>
%%SNIPPET_NormalCoupons%%
<tr class="SubTotal" style="%%GLOBAL_HideDiscountAmount%%">
<td colspan="6"><div>%%LNG_Discount%% <em class="ProductPrice">%%GLOBAL_DiscountAmount%%</em></div></td>
</tr>
<tr class="SubTotal" style="display:none;">
<td colspan="6" class="HL-ShoppingCartShippingEstimator">
<div>
<em>%%LNG_CalculateShippingHandling%%</em>
<div class="EstimateShipping" style="display: none;">
<div class="EstimatedShippingMethods" style="display: none;">
<div class="ShippingMethodList">
</div>
</div>
<dl class="hideThis">
<dt><span class="Required">*</span> %%LNG_Country%%:</dt>
<dd>
<select name="shippingZoneCountry" id="shippingZoneCountry" onchange="Cart.ToggleShippingEstimateCountry();">
%%GLOBAL_ShippingCountryList%%
</select>
</dd>
<dt><span class="Required" id="shippingZoneStateRequired">*</span> %%LNG_StateProvince%%:</dt>
<dd>
<select style="display: %%GLOBAL_ShippingHideStateList%%" name="shippingZoneState" id="shippingZoneState">
%%GLOBAL_ShippingStateList%%
</select>
<input style="display: %%GLOBAL_ShippingHideStateBox%%" type="text" class="Textbox" name="shippingZoneStateName" id="shippingZoneStateName" value="%%GLOBAL_AddressState%%" />
</dd>
<dt><span class="Required">*</span> %%LNG_ZipPostcode%%:</dt>
<dd><input type="text" class="Textbox" name="shippingZoneZip" id="shippingZoneZip" value="%%GLOBAL_ShippingZip%%" /></dd>
<!--dd class="Submit EstimateShippingButtons">
<input type="button" onclick="Cart.EstimateShipping();" value="%%LNG_CalculateShipping%%" class="btn alt" />
<div>%%LNG_Cancel%%</div>
</dd-->
</dl>
<p class="Submit EstimateShippingButtons">
<span>%%LNG_Cancel%% %%LNG_or%% </span><input type="button" onclick="Cart.EstimateShipping();" value="%%LNG_CalculateShipping%%" />
</p>
</div>
</div>
</td>
</tr>
<tr style="display:%%GLOBAL_HideShoppingCartShippingCost%%" class="SubTotal ShippingRow">
<td colspan="6"><div>%%LNG_Shipping%% (%%GLOBAL_ShippingProvider%%) <em class="ProductPrice">%%GLOBAL_ShippingCost%%</em></div></td>
</tr>
%%SNIPPET_FreeShippingCoupons%%
<tr style="display: %%GLOBAL_HideShoppingCartHandlingCost%%" class="SubTotal">
<td colspan="6"><div>%%LNG_Handling%% <em class="ProductPrice">%%GLOBAL_HandlingCost%%</em></div></td>
</tr>
%%GLOBAL_Taxes%%
%%SNIPPET_GiftCertificates%%
<tr class="SubTotal gtotal">
<td colspan="6"><div>%%LNG_GrandTotal%% <em class="ProductPrice">%%GLOBAL_CartTotal%%</em></div></td>
</tr>
%%GLOBAL_InclusiveTaxes%%
</tfoot>
<tbody>
%%SNIPPET_CartItems%%
</tbody>
</table>
<div class="KeepShopping">
Continue shopping
</div>
<div class="updateCart">
<input class="btn" type="submit" value="Update Cart" title="%%LNG_Update%%" />
</div>
</form>
<div class="ProceedToCheckout">
<!--div class="CheckoutButton" style="%%GLOBAL_HideCheckoutButton%%">
<a class="btn" href="%%GLOBAL_CheckoutLink%%" onclick="" title="%%LNG_CheckoutButtonTitle%%">%%LNG_HC_proceedcheckout%%</a>
</div-->
<div class="CheckoutButton" style="%%GLOBAL_HideCheckoutButton%%">
<a href="%%GLOBAL_CheckoutLink%%" onclick="%%GLOBAL_OptimizerLinkFunction%%" title="%%LNG_CheckoutButtonTitle%%">
%%GLOBAL_CartCheckoutButtonOptimizerScriptTag%%
<img src="https://cdn2.bigcommerce.com/server5400/vpslo31z/templates/__custom/images/blue/checkout.gif" alt="" />
%%GLOBAL_CartCheckoutButtonOptimizerNoScriptTag%%
</a>
</div>
<div class="AlternativeCheckout" style="%%GLOBAL_HideMultipleAddressShipping%%">
<p class="PTB20"><span style="%%GLOBAL_HideMultipleAddressShippingOr%%">-- %%LNG_or%% --</span><strong>%%LNG_CheckoutWithMultipleAddresses%%</strong></p>
</div>
%%GLOBAL_AdditionalCheckoutButtons%%
<div class="AlternativeCheckout">
<img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/ppcredit_MD_BNPOT_1x.png" alt="PayPal Credit" /> </div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div style="display: %%GLOBAL_HideShoppingCartEmptyMessage%%">
<p class="InfoMessage">
%%LNG_NoItemsInCart%%
</p>
%%LNG_EmptyCartInfo%%
<br>
%%LNG_ContinueShopping%% %%LNG_OnThe%% %%GLOBAL_StoreName%% %%LNG_EmptyHomePage%%
</div>
</div>
</div>
<script type="text/javascript">
if (location.pathname !== '/checkout.php'){
$('.EstimateShippingLink').click();
$('#shippingZoneCountry').val(226);
$('#shippingZoneState').val(51);
$('#shippingZoneZip').val(19132);
/*
$('#shippingZoneCountry').change(function() {
$('#shippingZoneState').val(51);
$('#shippingZoneState').change(function(){
$('#shippingZoneZip').val(19132);
});
});*/
$('.Submit.EstimateShippingButtons > input').click();
$('.hideThis').hide();
$('.Submit.EstimateShippingButtons').hide();
}
$(document).ready(function(){
//var labelForFixedShipping= $("div.shippingquote label").filter(function() { return ($(this).text().trim() === "Fixed Shipping") });
//$("#shippingLabel").text($("#shippingLabel").text().replace("Fixed Shipping", "Your Shipping Cost"));
//alert($('#shippingLabel').html());
//alert(labelForFixedShipping);
//alert("Text");
//alert(labelForFixedShipping.text());
//labelForFixedShipping.text("Your Shipping Cost");
var ht = $("label[for = shippingLabel]").text();
//alert(ht);
});
</script>
<script type="text/javascript">
$(function() {
var cartSubtotal = parseFloat("%%GLOBAL_CartItemTotal%%".replace(/[$,]/g, ''));
if (cartSubtotal > 50) {
$("<a href='http:/yourdomain.com/cart.php?action=add&product_id=8122'></a>").click();
}
});
</script>
<script>
if (location.pathname !== '/checkout.php'){
$(document).ajaxComplete(function(){
sessionStorage.setItem('totals', $('table.CartContents>tfoot').html());
});
}
</script>

expanding and collapsing table rows using angularjs ng-repeat -start and ng-repeat-end

i have one issue can anyone help me please...
i have a table in that table i have four users. and i have two icons(one is for expanding and another is for collapsing table rows data at time(all)) above table when i clicked on expand icon the data in table expanded and collapsed. so until this fine to me . now am going to expand particular row of table by clicking arrow(actually present in tr) it expanded particular row and collapsed that particular row. then this time if a clicked expand and collapse icons(expand all and collapse all). then expanding and collapsing are not working.
Here am using ng-repeat-start and ng-repeat-end.
<div class="comprehensiveINDiv" ng-show="visibleCarConferenceList">
<div class="top-bg-expand" >
<div class="col-md-5 color-blue">
<h1 class="main-heading1 ">Care Conference
<span class="expand-btns">
<a><i class="fa fa-compress color-blue" aria-hidden="true" ng-click="expanded = true"></i></a>
|
<a><i class="fa fa-expand" aria-hidden="true" ng-click="loadAllcareplans(); expanded = !expanded"></i></a>
</span>
</h1>
</div>
<div class="col-md-3 select-pan1 select-inner-pan1 careconfhed">
<label>Status: </label>
<select ng-model="filterOpt.opt"
ng-options="item.name for item in filterOpts.options"
ng-change="getCareConferenceList();resetPage();">
</select>
</div>
<div class="col-md-4 ">
<sm-range-picker-input class="margn0" fname="Range" label="Range"
form="test" ng-model="vm.rangeSelected" flex="100"
format="DD-MMM-YYYY" divider="To" week-start-day="Monday"
on-range-select="rangeSelected(range)"
ng-change="getCareConferenceList();">
</sm-range-picker-input>
</div>
</div>
<div ng-show="noConfData" class="margnL15">NO RECORDS FOUND</div>
<div>
<button type="button" class="btn btn-info btn-sm margnL15"
id="addnew_btn" ng-click="addNewconference();">ADD NEW</button>
</div>
<div ng-show="confGrid">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-data3 tablestyle" id="tbl1">
<thead>
<tr>
<th></th>
<th> Date / Time </th>
<th>Reason</th>
<th>Status </th>
<th>Action</th>
<!--<th>time</th>-->
</tr>
</thead>
<tbody>
<tr ng-show="noConfData"><td colspan="4" >NO RECORDS FOUND</td></tr>
<tr ng-repeat-start="careconf in residentCareConferenceList" class="md-table-content-row class_{{careconf.CareConferenceID}}">
<td><a ng-click="expanded = !expanded"><i class="fa fa-angle-right" aria-hidden="true"></i></a></td>
<td ng-class="customClass[h.field]" class="md-table-content">{{careconf.CareConferenceDate | date:'dd/MM/yyyy hh:mm a'}}</td>
<td ng-class="customClass[h.field]" class="md-table-content">{{careconf.ReasonDescription}}</td>
<td ng-class="customClass[h.field]" class="md-table-content">{{careconf.careconferencestatus.CareConferenceStatusDescription}}</td>
<td><span class="fa fa-pencil" ng-click="EditCareConference(careconf.CareConferenceID);$event.stopPropagation();"></span></td>
<!--<td ng-class="customClass[h.field]" class="md-table-content">{{careconf.TotalTime}}</td>-->
</tr>
<tr ng-repeat-end ng-class="{'hide' : expanded}">
<td colspan="5" style="width: 100%; border:none !important; padding-left:20px;">
<div class="col-md-12 scrolldata">
<div class="col-md-12 ">
<div class="col-md-12 residance-data-text">
<p>Facility :{{careconf.facilitybase.FacilityName }}</p>
<p> Resident : {{currentResident.personbase.FullName}}</p>
<p> Admitted :{{currentResidentDetails.AdmitReAdmiDischDate | date:'dd/MM/yyyy hh:mm a'}}</p>
<p> Physician : {{residentprovider}}</p>
</div>
</div>
<div class="col-md-12" id="table">
<div class="col-md-12">
<!-- Table one -->
<p> Interdisciplinary team members involved in this Resident's Care Planning since last Care Conference ({{careconf.LastCareConferenceDate | date:'dd/MM/yyyy hh:mm a'}}) :</p>
<div class="tablestyledit">
<table class="table">
<tr>
<th width="50%" class="bdr-table">Name </th>
<th width="50%" class="bdr-table">Credentials </th>
</tr>
<tr ng-repeat="teamMember in careconf.teamMembers">
<td class="bdr-table">{{teamMember.ParticipantName}}</td>
<td class="bdr-table">{{teamMember.ParticipantRole}}</td>
</tr>
</table>
</div>
<div class="col-md-12" style="padding-top:0px;">
<div class="row">
<div class="md-form">
<p style="margin:0px;">Care Conference Summary</p>
<div class="empty-text">{{careconf.CareConferenceSummary}}</div>
</div>
</div>
</div>
<!--- /Table one -->
<!-- Table two -->
<div class="col-md-12" style="padding:0px;">
<p style="margin:0px; padding-top:10px;">Care Conference Participants :</p>
<div class="tablestyledit">
<table class="table ">
<tr>
<th width="50%" class="bdr-table">IDT Participant Name</th>
<th width="25%" class="bdr-table">Credentials</th>
<th width="25%" class="bdr-table">In Person</th>
</tr>
<tr ng-repeat="participant in careconf.participants">
<td class="bdr-table">{{participant.ParticipantName}}</td>
<td class="bdr-table">{{participant.ParticipantRole}}</td>
<td class="bdr-table">
<fieldset class="form-group">
<input type="checkbox" data-ng-model="participant.IsInPerson" disabled>
</fieldset>
</td>
</tr>
</table>
</div>
</div>
<!--/ Table two -->
<!-- Table three -->
<div class="col-md-12" style="padding:0px;">
<p style="margin:0px; padding-top:10px;">Family/Resident Attendance : </p>
<div class="tablestyledit">
<table class="table table-data-sub ">
<tr>
<th class="bdr-table">Name of person Invited</th>
<th class="bdr-table">Relationship</th>
<th class="bdr-table">Attended</th>
<th class="bdr-table">In Person</th>
</tr>
<tr ng-repeat="familyMember in careconf.familyMembers">
<td class="bdr-table">{{familyMember.ParticipantName}}</td>
<td class="bdr-table">{{familyMember.Relationship}}</td>
<td class="bdr-table">
<fieldset class="form-group">
<input type="checkbox" data-ng-model="familyMember.HasAttended" disabled>
</fieldset>
</td>
<td class="bdr-table">
<fieldset class="form-group">
<input type="checkbox" data-ng-model="familyMember.IsInPerson" disabled>
</fieldset>
</td>
</tr>
</table>
</div>
</div>
<div class="col-md-12" style="margin-left:-15px;margin-bottom:8px;">
<p> Care Conference Date : {{careconf.CareConferenceDate | date:'dd/MM/yyyy hh:mm a'}}</p>
<p>Signed by:</p>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<div flex layout="column" class="pagi-nation">
<div ng-show="confTotal > 1" flex layout="column">
<section layout="row" layout-padding="">
<div class="col-md-5 col-xs-12">Showing Page <strong>{{confPage}}</strong></div>
<div class="col-md-7 col-xs-12">
<cl-paging id="confPage" flex cl-pages="confTotal" , cl-steps="3" , cl-page-changed="loadConfPages.onPageChanged()" , cl-align="center center"
, cl-current-page="Paging.currentPage"></cl-paging>
</section>
</div>
</div>
</div>
</div>
</div>
</div>
<div ng-show="visibleCarConferenceAdd">
<div ng-include="'views/doctor/addCareConference.html'"></div>
</div>
</div>
and my controller code
$scope.loadAllcareplans = function () {
$scope.expanded = true;
}
and finally am so sorry for my stupid english. and check my functinality (expanded, $scope.loadAllcareplans() and icons at careconference foe expanding and collapsing all table data )
Check this fiddle
The content is not what you provided.
But the logic will be this
https://jsfiddle.net/athulnair/wkz5oq9z/
$scope.collapseAll = function() {
$scope.data.forEach(function(item) {
item.isCollapsed = false;
})
}
Rather than using the above ng-click function in the tag you could go with javascript and adding/removing classes dynamically.I have used ui-bootstrap and glyphicon. Follow the below code.
HTML:
<a data-toggle="collapse" data-target="#test"><i class="test_icon glyphicon glyphicon-collapse-down"></i><h4 class="header"> Test Class </h4></a>
JavaScript
$('#test').on('hidden.bs.collapse', function () {
$(".test_icon").removeClass("glyphicon-collapse-down").addClass("glyphicon-collapse-up");
});
$('#test').on('shown.bs.collapse', function () {
$(".test_icon").removeClass("glyphicon-collapse-up").addClass("glyphicon-collapse-down");
});

Baseball Statistics Through a Form

I am trying to make an application for compiling baseball statistics. I would like to be able to enter information about an at-bat and receive statistics.
I would like to be able to show the amount of times singles double triple home run and divide that by the amount of times the at-bat form has been answered. Basically, I want to show Batting Average by doing (single+double+triple+homerun)/(atbats-walks). I would also like to show groundball/(at-bats-walks), flyball/(atbats-walks), and (((1*single)+(2*double)+(3*triple)+(4*homerun))/(atbats)), etc. I only know Ruby, HTML, and CSS.
Here is my at-bat form page
<style>
h1 {
color: white;
}
.moveloco {
text-align:center;;
color:white;
}
.moveloco2 {
text-align:center;
}
.centit {
text-align:center;
}
</style>
<h1 class= "moveloco">Input Statistics: Location 1</h1>
<div class="container">
<div class="row">
<div class="col-md-4">
<br />
<br />
<div style="background:rgba(255,255,255,0.5)" class="jumbotron">
<h3>What was the Pitch Type?</h3>
<br />
<h3>Where did the Ball Go?</h3>
<br />
<select input id="end_ball_location" name="ebloco">
<option value='lout'>Left Field</option>
<option value='cout'>Center Field</option>
<option value='rout'>Right Field</option>
<option value='lin'>Left Side of the Infield</option>
<option value='min'>Middle of the Infield </option>
<option value='rin'>Right Side of the Infield</option>
</select>
<br />
<br />
<br />
<br />
</div>
</div>
<div class="col-md-4">
<br />
<br />
<br />
<br />
<br />
<img src = "http://i62.tinypic.com/2gt51dc.png" alt="field" height="350" width="400">
<br />
</div>
<br />
<div class="col-md-4">
<br />
<div style="background:rgba(255,255,255,0.5)" class="jumbotron">
<div class='moveloco2'>
<h3>What Type of Hit was It?</h3>
</div>
<br />
<div class='moveloco2'>
<select id="hit_type" name="hit_type">
<option value='gball'>Groundball</option>
<option value='ld'>Line Drive</option>
<option value='flyball'>Fly Ball</option>
</select>
<br />
<br />
</div>
<div class='moveloco2'>
<h3>What was the At Bat Result?</h3>
<br />
<div class='moveloco2'>
<select id="at_bat_result" name="at_bat_result">
<option value='single'>Single</option>
<option value='double'>Double</option>
<option value='triple'>Triple</option>
<option value='homerun'>Home Run</option>
<option value='out'>Out</option>
<option value='walk'>Walk</option>
</select>
<br />
<br />
<br />
</div>
<div class='moveloco2'>
<input type='submit'>
</div>
</div>
</div>
</div>
</div>
application controller
I don't know what to put.
statistics show page
<style>
table, th, td {
border: 1px solid black;
}
.pwsth, .container {
text-align:center;
}
.tfass {
text-align:center;
color:white;
}
.pagination {
}
</style>
<br />
<div class="tfass">
<h1 class="text-center">Batting Statistics</h1>
</div>
<div class="container">
<div class="row">
<div class="col-md-4">
<br />
<br />
<br />
<br />
<img src = "http://i59.tinypic.com/nvbay1.png" alt="field" height="300" width="300">
</div>
<div class="col-md-4">
<br />
<br />
<br />
<br />
<img src = "http://i62.tinypic.com/2gt51dc.png" alt="field" height="350" width="400">
</div>
<div class="col-md-4">
<div style="background:rgba(255,255,255,0.5)" class="jumbotron">
<div class="asd">
<h3 class="text-center">Pitch Location 1</h3>
<br />
<table style="width:100%">
<tr>
<th class= "pwsth">BA</th>
<th class= "pwsth">SLG</th>
<th class= "pwsth">OPS</th>
</tr>
<tr>
<td class="pwsth">stat</td>
<td class="pwsth">stat</td>
<td class="pwsth">stat</td>
</tr>
<tr>
<th class= "pwsth">GB %</th>
<th class= "pwsth">FB %</th>
<th class= "pwsth">LD %</th>
</tr>
<tr>
<td class="pwsth">stat</td>
<td class="pwsth">stat</td>
<td class="pwsth">stat</td>
</tr>
<tr>
<th class= "pwsth">idk</th>
<th class= "pwsth">idk</th>
<th class= "pwsth">RC</th>
</tr>
<tr>
<td class="pwsth">idk</td>
<td class="pwsth">idk</td>
<td class="pwsth">stat</td>
</tr>
</table>
</div>
<nav class = "nacent">
<ul class="pagination">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<div></div><li>5</li>
<div></div>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<div></div>
<li>11</li>
<li>12</li>
<li>13</li>
<li>14</li>
<li>15</li>
<div></div>
<li>16</li>
<li>17</li>
<li>18</li>
<li>19</li>
<li>20</li>
<div></div>
<li>21</li>
<li>22</li>
<li>23</li>
<li>24</li>
<li>25</li>
<li>
</li>
</ul>
</div>
</nav>
</div>
</div>
</div>
You would need to use JavaScript or something similar if trying to calculate it client-side. If you don't know JavaScript here's a good start:
http://www.w3schools.com/js/default.asp

Selenium modal xpath

I need to select this input ...
(name="BtnNext" value="İLERİ" class="NavigationButtonNextLightBox ")
... with xpath after this modal popup. I cant use .FindByClass because there are same classes in the main page, but I need open which in (id="__LIGHTBOX__") modal;
<div style="overflow: visible; padding: 0px; width: auto; min-height: 143px; max-height: none; height: auto;" class="ui-dialog-content ui-widget-content" id="__LIGHTBOX__">
<div class="__BOX__">
<input name="BtnClose" class="BoxButtonClose" type="button">
<div>
<img src="/Content/themes/base/images/popup-bg-top.png">
</div>
<div class="popupCapsule clearFix">
<form action="/BillPayment/TransferInfo" method="post">
<div class="banner clearFix">
<h1 class="pageTitle">Fatura Ödeme</h1>
</div>
<div class="relatedPeopleContainer clearFix">
<div class="topDiv">
</div>
<div class="relatedPeople clearFix">
<table>
<tbody>
<tr>
<td class="t1">
<img src="Content/banks/bank205.png">
</td>
<td class="t2 SenderReceiverSubmit" rowspan="2" style="cursor: pointer;">
<div class="arrow">
</div>
</td>
<td class="t3">
<img src="Content/company/Turkcell.png">
</td>
</tr>
<tr>
<td class="t4">
<div class="info right">
<h2 class="NavigationButtonIndex" style="cursor: pointer;" title="Hesabınızı değiştirmek için tıklayınız.">HESABIM
<img src="/Content/themes/base/images/change-account.png" alt="" style="height: 20px; vertical-align: text-bottom;">
</h2>
<p class="first">
Beşyüzevler Şube
</p>
<p>
Cari Hesap
</p>
<p>
10136046-1
</p>
<p>
1.256,51 TL
</p>
</div>
</td>
<td class="t6">
<div class="info left">
<h2>TURKCELL
</h2>
<p class="first">
1774862559
</p>
<p>
5303003816
</p>
<p>
23,40 TL
</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bottomDiv">
</div>
</div>
<div class="amountEntry clearFix">
<table class="moneyEditorTable ">
<tbody>
<tr>
<td>
<input class="integerinput " data-val="true" data-val-regex="The field Integer must match the regular expression '[0-9.,]{1,11}'." data-val-regex-pattern="[0-9.,]{1,11}" datavalrequired="" disabled="disabled" id="IntegerInput" name="Amount.Integer" onkeyup=";" value="23" type="text"></td>
<td class="spanTd">
<span class="currency ">,</span>
</td>
<td>
<input maxlength="2" class="decimalinput " data-val="true" data-val-range="The field Decimal must be between 0 and 99." data-val-range-max="99" data-val-range-min="0" datavalrequired="" disabled="disabled" id="DecimalInput" name="Amount.Decimal" onkeypress="return BOA.Web.Validation.NumericControl(event);" onkeyup=";BOA.Web.Validation.DecimalPoint(event, $(this));" onpaste="BOA.Web.Validation.NumericEditorPaste(event, $(this));" value="40" type="text"></td>
<td class="spanTd">
<span class="currency ">TL</span>
</td>
</tr>
</tbody>
</table>
<input id="Amount_FECCode" name="Amount.FECCode" value="TL" type="hidden">
<div class="Error clearFix">
<span class="field-validation-valid" data-valmsg-for="Amount" data-valmsg-replace="true"></span>
</div>
</div>
<table class="popupButtonArea">
<tbody>
<tr>
<td class="left">
<input name="BtnPrev" value="GERİ" class="NavigationButtonPrev " type="button">
</td>
<td class="right">
<input name="BtnNext" value="İLERİ" class="NavigationButtonNextLightBox " type="button">
<input name="FromStep" value="TransferInfo" type="hidden">
</td>
</tr>
</tbody>
</table>
<input name="__RequestVerificationToken" value="jzI4c0v-PPC60xzaY8B2FDiCLYmHwCCtQsYv7UbBIMgnBWFeEpJoLLMDgf4LGl24WxhfizGlsqEJdjhywzgNHT785XHRzmwcU2qDyaQfSh6SajD8WKCAEq2L8CejPMJ65QL45A2" type="hidden">
</form>
</div>
<div>
<img src="/Content/themes/base/images/popup-bg-sub.png">
</div>
</div>
</div>
You can try to find the element by the following xpath :
//div[contains(#id, 'LIGHTBOX')]//input[#name='BtnNext' and contains(#class, 'NavigationButtonNextLightBox')]
Above xpath attempt to find a <div> having id contains LIGHTBOX, then from within that <div> get <input> element having name attribute equals BtnNext and class attribute contains NavigationButtonNextLightBox
Not sure am i missing somehting here, but whats stopping you from selecting by name?
WebElement btnNext = driver().findElement(By.name("BtnNext"));