Exemplo n.º 1
0
		void InitTable (TableElement table)
		{
			InitListGastos ();
			DefineTableColumns();

			table.ClassName = "table table-striped table-hover table-condensed";
			table.SetAttribute ("data-provides", "rowlink");
			table.CreateHeader (Columns);

			table.JSelectRows ().Live ("click", e =>  {
				Cayita.Javascript.Firebug.Console.Log ("event click row e", e);
				var row = (TableRowElement)e.CurrentTarget;
				table.JSelectRows ().RemoveClass ("info");
				row.JSelect ().AddClass ("info");
				SelectedGasto.Index = row.GetIndex ();
				SelectedGasto.Row = row;
				var gasto = ListGastos.FirstOrDefault (f => f.Id == int.Parse (SelectedGasto.Index));
				BDelete.Element ().Disabled = false;
				BList.Element ().Disabled = false;
				Form.Element ().Reset ();
				Form.Element ().Load (gasto);
				GridDiv.Hide ();
				FormDiv.Element ().FadeIn ();

			});
		}
Exemplo n.º 2
0
		void LoadFuentes(TableElement table)
		{
			InitListFuentes();
			jQuery.GetData<BLResponse<Fuente>>("api/Fuente/read", new {}, cb=>{},"json")
				.Success(data=>{
					ListFuentes= data.Result;
					table.Load(ListFuentes, Columns);
					table.JSelectRows ().AddClass ("rowlink");
				})
					.Error((request,  textStatus,  error)=>{
						table.Load(ListFuentes, Columns);
						Cayita.Javascript.Firebug.Console.Log("error", request, textStatus, error);
						Div.CreateAlertErrorBefore(table, textStatus +": " + request.StatusText);
					})
					.Always(a=>{});
		}