mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
feat: Basic Query + Autocomplete
This commit is contained in:
committed by
marination
parent
0c47f3a876
commit
e82833f14a
5
erpnext/www/all-products/search.css
Normal file
5
erpnext/www/all-products/search.css
Normal file
@@ -0,0 +1,5 @@
|
||||
.item-thumb {
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
object-fit: cover;
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
|
||||
{% block title %}{{ _('Search') }}{% endblock %}
|
||||
|
||||
{%- block head_include %}
|
||||
<link rel="stylesheet" href="search.css">
|
||||
{% endblock -%}
|
||||
|
||||
{% block header %}
|
||||
<div class="mb-6">{{ _('Search Products') }}</div>
|
||||
{% endblock header %}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
console.log("search.js loaded");
|
||||
console.log("search.js reloaded");
|
||||
|
||||
const search_box = document.getElementById("search-box");
|
||||
const results = document.getElementById("results");
|
||||
|
||||
function populateResults(data) {
|
||||
console.log(data);
|
||||
html = ""
|
||||
for (let res of data.message) {
|
||||
html += `<li>${res}</li>`
|
||||
html += `<li>
|
||||
<img class="item-thumb" src="${res.thumbnail || ''}" />
|
||||
<a href="/${res.route}">${res.web_item_name}</a>
|
||||
</li>`
|
||||
}
|
||||
console.log(html);
|
||||
results.innerHTML = html;
|
||||
|
||||
Reference in New Issue
Block a user