Display icons in supplier_part list

- Bug fix for part list API query
This commit is contained in:
Oliver Walters 2019-05-08 20:16:53 +10:00
parent 88a1df75d2
commit 0754afd5f5
3 changed files with 8 additions and 6 deletions

View File

@ -51,10 +51,10 @@
},
{
sortable: true,
field: 'part_name',
field: 'part_detail.name',
title: 'Part',
formatter: function(value, row, index, field) {
return renderLink(value, '/part/' + row.part + '/suppliers/');
return imageHoverIcon(row.part_detail.image_url) + renderLink(value, '/part/' + row.part + '/suppliers/');
}
},
{

View File

@ -125,7 +125,7 @@ class SupplierPartSerializer(serializers.ModelSerializer):
url = serializers.CharField(source='get_absolute_url', read_only=True)
part_name = serializers.CharField(source='part.name', read_only=True)
part_detail = PartBriefSerializer(source='part', many=False, read_only=True)
supplier_name = serializers.CharField(source='supplier.name', read_only=True)
@ -135,7 +135,7 @@ class SupplierPartSerializer(serializers.ModelSerializer):
'pk',
'url',
'part',
'part_name',
'part_detail',
'supplier',
'supplier_name',
'SKU',

View File

@ -86,7 +86,9 @@ function loadPartTable(table, url, options={}) {
*/
// Default query params
options.active = true;
query = options.query;
query.active = true;
$(table).bootstrapTable({
url: url,
@ -98,7 +100,7 @@ function loadPartTable(table, url, options={}) {
pageSize: 25,
rememberOrder: true,
queryParams: function(p) {
return options;
return query;
},
columns: [
{