Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FrmInvitationToTender {
- val gridCatalog = new GridCatalogs()
- val onChoiceItem = SinkObserver.create[ ( String, String ) ]{ case ( id, description ) =>
- grid.hdlRowActive.foreach { idx =>
- store.store.onNext (
- store.UpdateIdx(idx, Tenderer (id_comparative = "100-2019-ADQ2",key_provider = id, business_name = Some(description)))
- )
- }
- hdlCatalog.onNext(Seq.empty)
- Continue
- }
- val gridCatalogSearchResult = grid.hdlPositionCursor.combineLatest ( hdlCatalog ).map { case ( pos, catalog ) =>
- val cata = catalog.map ( i => i._1 -> i._2 ).toMap
- if (!catalog.isEmpty)
- Some(gridCatalog.render(cata, pos, cata.isEmpty, onChoiceItem))
- else
- None
- }
- def mainGrid ( items: Map [ Int, Map [ String,String ] ] ) =
- div ( clear.both, marginTop := "40px",
- grid.render ( items ),
- gridCatalogSearchResult
- )
- def render = store.store.switchMap { case (a, s) => // concatMap or switchMap { s => // for { s <- store.store } yield {
- val dataGrid = s.tenderers.items.zipWithIndex.map{case(prov,i)=>i->Seq("rfc"->prov.key_provider,"proveedor"->prov.business_name.getOrElse("")).toMap }.toMap
- Observable ( mainGrid(dataGrid) )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement