def index(self): _ = self.R cols_name = [FieldsGrid('id', 'ID', visible=False).to_dict(), FieldsGrid('name', 'Slider Name', editable=True).to_dict(), FieldsGrid('category', 'Slider Category', editable=dict( type='select', source=[{'value': 'JD', 'text': 'Dorama'}, {'value': 'AN', 'text': 'Anime'}, {'value': 'KD', 'text': 'KDrama'}])).to_dict(), FieldsGrid('type', 'Slider Position', editable=dict( type='select', source=[{'value': 'HR', 'text': 'Header'}, {'value': 'BT', 'text': 'Bottom'}, {'value': 'MD', 'text': 'Middle'}])).to_dict(), FieldsGrid('detail', 'Detail', width=50, align='left', valign='middle', actionable=dict(iconcls='fa fa-list-alt')).to_dict(), FieldsGrid('delete', 'Delete', width=50, align='left', valign='middle', actionable=dict(iconcls='fa fa-trash-o')).to_dict()] data = dict(title="Master Images Slider") # print(utils.dumps(cols_name)) return dict(project="slider", cols=utils.dumps(cols_name), data=data)
def index(self): _ = self.R cols_name = [FieldsGrid('id', 'ID', visible=False).to_dict(), # master slider FieldsGrid('pid', 'Slider Name', editable=dict( type='select', source=[dict(value=slide.id, text=slide.name) for slide in Slider.query.all()])).to_dict(), FieldsGrid('image', 'Image', editable=True).to_dict(), FieldsGrid('url', 'Link Url', editable=True).to_dict(), FieldsGrid('detail', 'Detail', width=50, align='left', valign='middle', actionable=dict(iconcls='fa fa-list-alt')).to_dict(), FieldsGrid('delete', 'Delete', width=50, align='left', valign='middle', actionable=dict(iconcls='fa fa-trash-o')).to_dict()] sliders = [(slide.id, slide.name) for slide in Slider.query.all()] data = dict(title="List Images Slider", sliders=sliders) # print(utils.dumps(cols_name)) return dict(project="slider", cols=utils.dumps(cols_name), data=data)