Subversion Repositories SmartDukaan

Rev

Rev 32674 | Rev 33954 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32674 Rev 33412
Line 90... Line 90...
90
 
90
 
91
			</div>
91
			</div>
92
		</div>
92
		</div>
93
		</form>
93
		</form>
94
 
94
 
95
   <div class="col-lg-12 form-group">
-
 
96
	  <input type="text" id="searchInput" placeholder="Search..." class="form-control pull-right" style="width:150px;">
-
 
97
	</div>
-
 
98
	<div id="focused-model-table">
95
	<div id="focused-model-table">
99
		<div class="row">
96
		<div class="row">
100
	    	<div class="col-lg-12">
97
	    	<div class="col-lg-12">
101
				<table class="table table-striped table-advance table-hover" id="myTable" >
98
				<table class="table table-striped table-advance table-hover" id="focusTable">
102
                    <thead>
99
                    <thead>
103
                        <tr>
100
                        <tr>
104
							<th>Item Name</th>
101
							<th>Item Name</th>
105
                            <th>Recommended Quantity </th>
102
                            <th>Recommended Quantity </th>
106
                            <th>Minimum Quantity</th>
103
                            <th>Minimum Quantity</th>
Line 141... Line 138...
141
	    			</tbody>
138
	    			</tbody>
142
	    		</table>
139
	    		</table>
143
	    	</div>
140
	    	</div>
144
	    </div>
141
	    </div>
145
    </div>
142
    </div>
146
    
-
 
147
        #if(!$focusedModels.isEmpty())
-
 
148
    	<div class="row" id="focused-model-paginated">
-
 
149
			<div class="col-lg-9">
-
 
150
    			<p>Showing <span class="start">$start</span> to <span class="end">$end</span> of <span class="size">$size</span> items</p>
-
 
151
			</div>
-
 
152
			<div class="col-lg-4" style="text-align:right;float:right">
-
 
153
				<div class="btn-group" style="width:40%">
-
 
154
					<button class="btn btn-primary previous" disabled="disabled" style="width:100%">Previous</button>
-
 
155
				</div>
-
 
156
				<div class="btn-group" style="width:40%">
-
 
157
					#if($end >= $size)
-
 
158
						<button class="btn btn-primary next" style="width:100%" disabled="disabled">Next</button>
-
 
159
					#else
-
 
160
						<button class="btn btn-primary next" style="width:100%">Next</button>
-
 
161
					#end
-
 
162
				</div>
-
 
163
	    	</div>
-
 
164
	    </div>
-
 
165
    #end
-
 
166
    </div>
143
    </div>
167
</section>
144
</section>
168
 
145
 
169
<div id="focused-model-container" style="background:white;background-color:white;">
146
<div id="focused-model-container" style="background:white;background-color:white;">
170
</div>
147
</div>
171
<script>
148
<script>
172
    // Function to perform the table row filtering
-
 
173
    function filterTable() {
149
	$(document).ready(function () {
174
        var input, filter, table, tr, td, i, txtValue;
-
 
175
        input = document.getElementById("searchInput");
-
 
176
        filter = input.value.toUpperCase();
-
 
177
        table = document.getElementById("myTable");
150
		var dtable = $('#focusTable').DataTable({
178
        tr = table.getElementsByTagName("tr");
-
 
179
 
-
 
180
        for (i = 0; i < tr.length; i++) {
-
 
181
            td = tr[i].getElementsByTagName("td")[0]; // Change index based on the column you want to search
-
 
182
            if (td) {
-
 
183
                txtValue = td.textContent || td.innerText;
-
 
184
                if (txtValue.toUpperCase().indexOf(filter) > -1) {
-
 
185
                    tr[i].style.display = "";
-
 
186
                } else {
-
 
187
                    tr[i].style.display = "none";
-
 
188
                }
-
 
189
            }
-
 
190
        }
-
 
191
    }
-
 
192
 
151
 
-
 
152
			pageLength: 10,
-
 
153
			paging: true,
193
    // Attach an event listener to the search input
154
			scrollCollapse: true,
-
 
155
			fixedHeader: true,
-
 
156
			columnDefs: [
-
 
157
				{
-
 
158
					targets: [7],
194
    document.getElementById("searchInput").addEventListener("input", filterTable);
159
					searchable: false
-
 
160
				}
-
 
161
			]
-
 
162
		});
-
 
163
	});
195
</script>
164
</script>
196
 
165
 
197
 
166